7.Ubuntu16.04Docker获取和推送镜像

来源:互联网 发布:陕西天互数据 编辑:程序博客网 时间:2024/05/21 06:13

Ubuntu16.04Docker获取和推送镜像

查找镜像

Docker Hub

http://registry.hub.docker.com

docker search [OPTIONS] TERM--automated=false 自动化选项,只会显示自动化构件的镜像 --no-trnc=false 不以截断的方式显示-s --stars=0 通过星级过滤eggyer@ubuntu:/usr/local$ docker search ubuntuNAME                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATEDubuntu                            Ubuntu is a Debian-based Linux operating s...   5099      [OK]       ubuntu-upstart                    Upstart is an event-based replacement for ...   69        [OK]       rastasheep/ubuntu-sshd            Dockerized SSH service, built on top of of...   53                   [OK]ubuntu-debootstrap                debootstrap --variant=minbase --components...   27        [OK]       torusware/speedus-ubuntu          Always updated official Ubuntu docker imag...   27                   [OK]ioft/armhf-ubuntu                 [ABR] Ubuntu Docker images for the ARMv7(a...   19                   [OK]nuagebec/ubuntu                   Simple always updated Ubuntu docker images...   11                   [OK]nickistre/ubuntu-lamp             LAMP server on Ubuntu                           11                   [OK]nickistre/ubuntu-lamp-wordpress   LAMP on Ubuntu with wp-cli installed            7                    [OK]nimmis/ubuntu                     This is a docker images different LTS vers...   5                    [OK]maxexcloo/ubuntu                  Base image built on Ubuntu with init, Supe...   2                    [OK]jordi/ubuntu                      Ubuntu Base Image                               1                    [OK]admiringworm/ubuntu               Base ubuntu images based on the official u...   1                    [OK]darksheer/ubuntu                  Base Ubuntu Image -- Updated hourly             1                    [OK]vcatechnology/ubuntu              A Ubuntu image that is updated daily            0                    [OK]widerplan/ubuntu                  Our basic Ubuntu images.                        0                    [OK]esycat/ubuntu                     Ubuntu LTS                                      0                    [OK]ustclug/ubuntu                    ubuntu image for docker with USTC mirror        0                    [OK]uvatbc/ubuntu                     Ubuntu images with unprivileged user            0                    [OK]datenbetrieb/ubuntu               custom flavor of the official ubuntu base ...   0                    [OK]webhippie/ubuntu                  Docker images for ubuntu                        0                    [OK]labengine/ubuntu                  Images base ubuntu                              0                    [OK]konstruktoid/ubuntu               Ubuntu base image                               0                    [OK]lynxtp/ubuntu                     https://github.com/lynxtp/docker-ubuntu         0                    [OK]teamrock/ubuntu                   TeamRock's Ubuntu image configured with AW...   0                    [OK]

拉取镜像

docker pull [OPTION] NAME[:TAG]-a --all-tags=false 下载仓库中所有标记的镜像eggyer@ubuntu:/usr/local$ docker pull ubuntu:14.0414.04: Pulling from library/ubuntu07235cd0e105: Downloading [=====>                                             ] 7.024 MB/65.7 MB751bed4a496a: Download complete 1b389da167c9: Download complete cd4d9b716097: Download complete 2bb47aeaf95f: Download complete d267439203ef: Download complete 

使用–registry-mirror选项

从前面的测试中可以发现,从docker官网拉取镜像过程很慢

  1. 修改/etc/default/docker
  2. DOCKER_OPTS=”–registry-mirror=http://MIRROR-ADDR”

详情见:https://www.daocloud.io

推送镜像

注意要把推送镜像名改为 用户名/xxx的形式不然会出现You cannot push a “root” repository. Please rename your repository to / (ex: eggyer/ubuntu16.04)

docker push name[:TAG]eggyer@ubuntu:/usr/local$ docker loginUsername: eggyerPassword: Email: 812022339@qq.comWARNING: login credentials saved in /home/eggyer/.docker/config.jsonLogin Succeededeggyer@ubuntu:/usr/local$ docker tag bea8f41ae3e8 eggyer/ubuntu16.04eggyer@ubuntu:/usr/local$ docker imagesREPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZEubuntu               latest              bea8f41ae3e8        9 days ago          128.1 MBubuntu16.04          latest              bea8f41ae3e8        9 days ago          128.1 MBeggyer/ubuntu16.04   latest              bea8f41ae3e8        9 days ago          128.1 MBeggyer@ubuntu:/usr/local$ docker push eggyer/ubuntu16.04The push refers to a repository [docker.io/eggyer/ubuntu16.04] (len: 1)bea8f41ae3e8: Pushed 0d2ba69dbe3e: Pushed 67de889be945: Pushed 2f5519d4ff74: Pushed ed6ff6865688: Pushed 594949f005fe: Pushing [===================================>               ] 90.85 MB/128.1 MB
0 0
原创粉丝点击