简体   繁体   English

有没有办法告诉 docker 镜像中的 shell 命令可用?

[英]Is there a way to tell shell commands are available in a docker image?

I'm using the node docker images as a container for my build pipelines.我使用节点 docker 图像作为构建管道的容器。

An issue I frequently run into is that a binary that I expect to exist, doesn't and I have to wait for it fail in the build pipeline.我经常遇到的一个问题是,我希望存在的二进制文件不存在,我必须等待它在构建管道中失败。 The zip command is one such example. zip命令就是一个这样的例子。

I can run the docker image on my local machine and ssh in to test commands.我可以在我的本地机器上运行 docker 镜像并通过 ssh 来测试命令。

Is there a way to summarise what commands are available for a given image?有没有办法总结给定图像可用的命令?

Is there a way to summarise what commands are available for a given image?有没有办法总结给定图像可用的命令?

You could look at the contents of /bin :您可以查看/bin的内容:

$ docker run --rm -it --entrypoint=ls node /bin

or /usr/local/bin :/usr/local/bin

$ docker run --rm -it --entrypoint=ls node /usr/local/bin

etc...等等...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM