[英]How do I know which registry an image was pulled from in Docker?
在 Docker 我正在運行 DockerFile 設置如下:
# Comment
FROM python:3.8.3
RUN pip install matplotlib
我正在使用以下命令生成此圖像:
docker build -t myimage:mytag -f DockerFile.
這是我對它的作用的理解:
python:3.8.3
映像是從某個遠程注冊表“拉取”的myimage:mytag
我的問題是:有沒有辦法(以編程方式)確定從哪個注冊表中提取基本映像?
注冊表:您可以使用以下命令找到您的default
注冊表:
# docker info | grep -i registry
Registry: https://index.docker.io/v1/
如果您不指定另一個注冊表,它會向您顯示 docker 搜索的位置。
示例:從“默認”注冊表索引中提取 python:3.8.3.docker.io/v1/
# docker pull python:3.8.3
3.8.3: Pulling from library/python
...
...
...
Status: Downloaded newer image for python:3.8.3
docker.io/library/python:3.8.3
驗證圖像(您會看到,ImageID 沒有后綴):
# docker images | grep -i python
python 3.8.3 7f5b6ccd03e9 6 weeks ago 934MB
示例:從fedora registry
中提取圖像nginx
:
# docker pull registry.fedoraproject.org/f29/nginx
Using default tag: latest
latest: Pulling from f29/nginx
...
Status: Downloaded newer image for registry.fedoraproject.org/f29/nginx:latest
registry.fedoraproject.org/f29/nginx:latest
驗證圖像(您會看到,ImageID 現在有一個后綴):
# docker images | grep -i nginx
registry.fedoraproject.org/f29/nginx latest 225d690974f7 20 months ago 368MB
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.