简体   繁体   English

Docker:父映像中有什么可用?

[英]Docker: What's available in the parent image?

In docker how do I know what packages are available in the parent image I am using? 在docker中,我如何知道我正在使用的父映像中有哪些软件包?
I am trying something like: 我正在尝试类似的东西:

docker search python  

but I get some (network?) error. 但出现一些(网络?)错误。
I have the image locally. 我在本地有图像。 How would I search what packages I can use? 我将如何搜索可以使用的软件包?

docker search is the command you use to search for docker images on the docker hub . docker search是用于在docker hub上搜索docker映像的命令。

If I understood well your question, given an image (say alpine:latest ) you want to know what's inside that image. 如果我很好理解您的问题,给定一个图像(例如alpine:latest ),您想知道该图像中的内容。

If that's the case, the only thing you can do IMHO is just run the container and explore it. 如果是这样,您只能执行容器并对其进行浏览,才能做恕我直言。

You can do that for the alpine:latest image with the following command: 您可以使用以下命令对alpine:latest图像执行此操作:

docker run --rm -ti alpine:latest ash

You'll get a prompt inside an instance of the mentioned image and you can dig around to check what's available. 您会在所提到图像的实例内看到提示,并且可以四处查看以查看可用的图像。

There is no place where you can access informations about the content of an image in a structured way. 在任何地方都不能以结构化的方式访问有关图像内容的信息。

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

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