docker 镜像管理

来源:互联网 发布:网络诈骗的预防 编辑:程序博客网 时间:2024/05/21 08:01
docker:/root# docker search centosNAME                            DESCRIPTION                                     STARS     OFFICIAL   AUTOMATEDcentos                          The official build of CentOS.                   2028      [OK]       jdeathe/centos-ssh              CentOS-6 6.7 x86_64 / CentOS-7 7.2.1511 x8...   17                   [OK]jdeathe/centos-ssh-apache-php   CentOS-6 6.7 x86_64 / Apache / PHP / PHP M...   14                   [OK]million12/centos-supervisor     Base CentOS-7 with supervisord launcher, h...   9                    [OK]blalor/centos                   Bare-bones base CentOS 6.5 image                8                    [OK]nimmis/java-centos              This is docker images of CentOS 7 with dif...   7                    [OK]torusware/speedus-centos        Always updated official CentOS docker imag...   7                    [OK]nickistre/centos-lamp           LAMP on centos setup                            3                    [OK]nathonfowlie/centos-jre         Latest CentOS image with the JRE pre-insta...   3                    [OK]centos/mariadb55-centos7                                                        3                    [OK]consol/sakuli-centos-xfce       Sakuli end-2-end testing and monitoring co...   2                    [OK]softvisio/centos                Centos                                          1                    [OK]layerworx/centos                CentOS container with etcd, etcdctl, confd...   1                    [OK]yajo/centos-epel                CentOS with EPEL and fully updated              1                    [OK]timhughes/centos                Centos with systemd installed and running       1                    [OK]pacur/centos-7                  Pacur CentOS 7                                  1                    [OK]pacur/centos-6                  Pacur CentOS 6                                  1                    [OK]darksheer/centos                Base Centos Image -- Updated hourly             1                    [OK]lighthopper/orientdb-centos     A Dockerfile for creating an OrientDB imag...   1                    [OK]ustclug/centos                   USTC centos                                    0                    [OK]blacklabelops/centos            CentOS Base Image! Built and Updates Daily!     0                    [OK]jsmigel/centos-epel             Docker base image of CentOS w/ EPEL installed   0                    [OK]grayzone/centos                 auto build for centos.                          0                    [OK]lighthopper/openjdk-centos      A Dockerfile for creating an OpenJDK image...   0                    [OK]januswel/centos                 yum update-ed CentOS image                      0                    [OK]启动镜像:docker run -it centos /bin/bash-i 表示让容器的标准输入打开,-t 表示分配一个伪终端:/bin/bash 容器里面允许的/bin/bashdocker pull centos:6.5  获取容器:docker:/root# docker pull --helpUsage: docker pull [OPTIONS] NAME[:TAG|@DIGEST]  Pull an image or a repository from the registry拉取一个镜像或者一个存储库 从注册处查看镜像:docker:/root# docker imagesREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZEjanuswel/centos     latest              088820de4929        12 days ago         198.3 MB前台运行docker:docker:/root# docker run -it januswel/centos  /bin/bash[root@13fe7a3f05cc /]# 查看正在运行的容器:docker:/root# docker psCONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS               NAMES13fe7a3f05cc        januswel/centos     "/bin/bash"         About a minute ago   Up About a minute                       boring_torvalds   已经停掉的容器:docker:/root# docker ps -aCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES13fe7a3f05cc        januswel/centos     "/bin/bash"         2 minutes ago       Up 2 minutes                            boring_torvalds   创建 复制一个镜像:docker:/root# docker tag januswel/centos  jj123docker:/root# docker imagesREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZEjanuswel/centos     latest              088820de4929        12 days ago         198.3 MBjj123               latest              088820de4929        12 days ago         198.3 MBdocker 删除镜像:docker rmi  jj123:latest docker rmi REPOSITORY:TAGdocker:/root# docker imagesREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZEjanuswel/centos     latest              088820de4929        12 days ago         198.3 MBjj123               latest              088820de4929        12 days ago         198.3 MBdocker:/root# docker rmi  jj123:latest Untagged: jj123:latestdocker:/root# docker imagesREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZEjanuswel/centos     latest              088820de4929        12 days ago         198.3 MB修改tag:docker:/root# docker tag januswel/centos  linux123docker:/root# docker imagesREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZEjanuswel/centos     latest              088820de4929        12 days ago         198.3 MBlinux123            latest              088820de4929        12 days ago         198.3 MBdocker:/root# docker tag januswel/centos  linux123:jjdocker:/root# docker imagesREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZEjanuswel/centos     latest              088820de4929        12 days ago         198.3 MBlinux123            latest              088820de4929        12 days ago         198.3 MBlinux123            jj                  088820de4929        12 days ago         198.3 MB

0 0
原创粉丝点击