[root@localhost128 ~]# docker pull centos:centos7
centos7: Pulling from library/centos
Digest: sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e
Status: Image is up to date for centos:centos7
docker.io/library/centos:centos7
[root@localhost128 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos centos7 8652b9f0cb4c 9 months ago 204MB
二、跑起来再导出 tar
docker run centos:centos7 默认执行 /bin/bash 后会立刻退出,这是正常现象。用 docker ps -a 拿到容器 ID,再 docker export:
[root@localhost128 ~]# docker run centos:centos7
[root@localhost128 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
44604d80ea3a centos:centos7 "/bin/bash" 9 seconds ago Exited (0) 7 seconds ago