docker 镜像管理

时间:2023-03-08 23:18:23
docker 镜像管理
docker:/root# docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos 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/bash docker pull centos:6.5 获取容器: docker:/root# docker pull --help Usage: docker pull [OPTIONS] NAME[:TAG|@DIGEST] Pull an image or a repository from the registry 拉取一个镜像或者一个存储库 从注册处 查看镜像: docker:/root# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
januswel/centos latest 088820de4929 12 days ago 198.3 MB 前台运行docker: docker:/root# docker run -it januswel/centos /bin/bash
[root@13fe7a3f05cc /]# 查看正在运行的容器: docker:/root# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
13fe7a3f05cc januswel/centos "/bin/bash" About a minute ago Up About a minute boring_torvalds 已经停掉的容器: docker:/root# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
13fe7a3f05cc januswel/centos "/bin/bash" 2 minutes ago Up 2 minutes boring_torvalds 创建 复制一个镜像: docker:/root# docker tag januswel/centos jj123 docker:/root# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
januswel/centos latest 088820de4929 12 days ago 198.3 MB
jj123 latest 088820de4929 12 days ago 198.3 MB docker 删除镜像: docker rmi jj123:latest docker rmi REPOSITORY:TAG docker:/root# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
januswel/centos latest 088820de4929 12 days ago 198.3 MB
jj123 latest 088820de4929 12 days ago 198.3 MB docker:/root# docker rmi jj123:latest
Untagged: jj123:latest docker:/root# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
januswel/centos latest 088820de4929 12 days ago 198.3 MB 修改tag: docker:/root# docker tag januswel/centos linux123
docker:/root# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
januswel/centos latest 088820de4929 12 days ago 198.3 MB
linux123 latest 088820de4929 12 days ago 198.3 MB docker:/root# docker tag januswel/centos linux123:jj
docker:/root# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
januswel/centos latest 088820de4929 12 days ago 198.3 MB
linux123 latest 088820de4929 12 days ago 198.3 MB
linux123 jj 088820de4929 12 days ago 198.3 MB