При извлечении изображения с помощью Docker API извлекаются все теги для данного изображения. - PullRequest
0 голосов
/ 28 января 2019

При использовании Docker API для извлечения centos образа, основываясь на документации здесь , он начал загружать все возможные образы centos (5, 5.11, 6, 6.10 и т. Д.):

{"status":"Pulling from library/centos","id":"6.10"}
{"status":"Pulling fs layer","progressDetail":{},"id":"1c8f9aa56c90"}
{"status":"Downloading","progressDetail":{"current":539797,"total":69804062},"progress":"[\u003e                                                  ]  539.8kB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Downloading","progressDetail":{"current":5917381,"total":69804062},"progress":"[====\u003e                                              ]  5.917MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Downloading","progressDetail":{"current":12896965,"total":69804062},"progress":"[=========\u003e                                         ]   12.9MB/69.8MB","id":"1c8f9aa56c90"}
...
{"status":"Downloading","progressDetail":{"current":59587269,"total":69804062},"progress":"[==========================================\u003e        ]  59.59MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Downloading","progressDetail":{"current":64400069,"total":69804062},"progress":"[==============================================\u003e    ]   64.4MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Verifying Checksum","progressDetail":{},"id":"1c8f9aa56c90"}
{"status":"Download complete","progressDetail":{},"id":"1c8f9aa56c90"}
{"status":"Extracting","progressDetail":{"current":557056,"total":69804062},"progress":"[\u003e                                                  ]  557.1kB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Extracting","progressDetail":{"current":2228224,"total":69804062},"progress":"[=\u003e                                                 ]  2.228MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Extracting","progressDetail":{"current":3342336,"total":69804062},"progress":"[==\u003e                                                ]  3.342MB/69.8MB","id":"1c8f9aa56c90"}
...
{"status":"Extracting","progressDetail":{"current":15597568,"total":69804062},"progress":"[===========\u003e                                       ]   15.6MB/69.8MB","id":"1c8f9aa56c90"}
/home # {"status":"Extracting","progressDetail":{"current":16711680,"total":69804062},"progress":"[===========\u003e                                       ]  16.71MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Extracting","progressDetail":{"current":18382848,"total":69804062},"progress":"[=============\u003e                                     ]  18.38MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Extracting","progressDetail":{"current":20054016,"total":69804062},"progress":"[==============\u003e                                    ]  20.05MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Extracting","progressDetail":{"current":20611072,"total":69804062},"progress":"[==============\u003e                                    ]  20.61MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Extracting","progressDetail":{"current":21725184,"total":69804062},"progress":"[===============\u003e                                   ]  21.73MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Extracting","progressDetail":{"current":23396352,"total":69804062},"progress":"[================\u003e                                  ]   23.4MB/69.8MB","id":"1c8f9aa56c90"}
...
{"status":"Extracting","progressDetail":{"current":69804062,"total":69804062},"progress":"[==================================================\u003e]   69.8MB/69.8MB","id":"1c8f9aa56c90"}
{"status":"Pull complete","progressDetail":{},"id":"1c8f9aa56c90"}
{"status":"Digest: sha256:b4c3fe75b135ca1c26ef6feb8153aade8a31c4e3e763376529c1088de7e973f4"}
{"status":"Pulling from library/centos","id":"6.6"}
{"status":"Pulling fs layer","progressDetail":{},"id":"f9f73d801f05"}
{"status":"Downloading","progressDetail":{"current":539318,"total":73694253},"progress":"[\u003e                                                  ]  539.3kB/73.69MB","id":"f9f73d801f05"}
{"status":"Downloading","progressDetail":{"current":7477942,"total":73694253},"progress":"[=====\u003e                                             ]  7.478MB/73.69MB","id":"f9f73d801f05"}
...
{"status":"Downloading","progressDetail":{"current":50543286,"total":73694253},"progress":"[==================================\u003e                ]  50.54MB/73.69MB","id":"f9f73d801f05"}
{"status":"Downloading","progressDetail":{"current":55929526,"total":73694253},"progress":"[=====================================\u003e             ]  55.93MB/73.69MB","id":"f9f73d801f05"}

Я использовал следующий API:

curl -X POST -H "Content-Type: application/json" --unix-socket /var/run/docker.sock http://v1.27/images/create?fromImage=centos&tag=latest 

Они упомянули, что мне нужно указать параметр tag, чтобы предотвратить загрузку всех изображений:

Тег или дайджест.Если при извлечении изображения пусто, это приводит к вытягиванию всех тегов для данного изображения.

Я сделал это, и все равно он загружает все изображения.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...