Dockerの基本1-Dockerイメージをダウンロードして作成する2つの方法:

1.指定されたバージョンのミラーイメージを取得してダウンロードする方法:

https://hub.docker.com/

この場所に移動して検索すると、次のようなものが表示されます
ここに画像の説明を挿入

2. 2番目の方法では、プラグイン
インストールすることですべてのミラーリスト情報を取得できます。この例では、centosを例として取り上げています。他のクエリを実行する場合は、以下のcentosを必要なコンテンツに置き換えてください。

curl -s https://registry.hub.docker.com/v1/repositories/centos/tags|jq|grep name

2.1プラグイン(jq)を使用する前にインストールする必要があります

yum install jq

2.2centosミラーの例

[root@centos77 ~]# curl -s https://registry.hub.docker.com/v1/repositories/centos/tags|jq|grep name
    "name": "latest"
    "name": "5"
    "name": "5.11"
    "name": "6"
    "name": "6.10"
    "name": "6.6"
    "name": "6.7"
    "name": "6.8"
    "name": "6.9"
    "name": "7"
    "name": "7.0.1406"
    "name": "7.1.1503"
    "name": "7.2.1511"
    "name": "7.3.1611"
    "name": "7.4.1708"
    "name": "7.5.1804"
    "name": "7.6.1810"

2.3nginxミラーの例

[root@centos77 ~]# curl -s https://registry.hub.docker.com/v1/repositories/nginx/tags|jq|grep name
    "name": "latest"
    "name": "1"
    "name": "1-alpine"
    "name": "1-alpine-perl"
    "name": "1-perl"
    "name": "1.10"
    "name": "1.10-alpine"
    "name": "1.10.0"
    "name": "1.10.0-alpine"
    "name": "1.10.1"
    "name": "1.10.1-alpine"
    "name": "1.10.2"
    "name": "1.10.2-alpine"
    "name": "1.10.3"
    "name": "1.10.3-alpine"
    "name": "1.11"
    "name": "1.11-alpine"
    "name": "1.11.0"
    "name": "1.11.0-alpine"

2.4ミラーリスト情報を取得した後、リスト内のコンテンツをダウンロードできます

例:
ダウンロードする例として、nginxの1.11をダウンロードします。


[root@centos77 ~]# docker pull nginx:1.11

2.5ミラーをダウンロードする方法を表示します。


[root@centos77 ~]# docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
busybox               latest              b97242f89c8a        8 days ago          1.23MB
httpd                 latest              683a7aad17d3        9 days ago          138MB
debian                latest              e7d08cddf791        10 days ago         114MB
centos                latest              300e315adb2f        6 weeks ago         209MB
mysql                 5.7                 413be204e9c3        9 months ago        456MB
portainer/portainer   latest              2869fc110bf7        10 months ago       78.6MB
tomcat                latest              a7fa4ac97be4        10 months ago       528MB
nginx                 latest              6678c7c2e56c        10 months ago       127MB
centos                6.8                 82f3b5f3c58f        22 months ago       195MB
centos                7.5.1804            cf49811e3cdb        22 months ago       200MB
nginx                 1.11                5766334bdaa0        3 years ago         183MB
[root@centos77 ~]#


おすすめ

転載: blog.csdn.net/wtt234/article/details/112979848