root@docker_01 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hub.c.163.com/public/centos 6.7-tools b2ab0ed558bb 6 weeks ago 601.9 MB
hub.c.163.com/public/centos 7.0 2ce04a284fa8 9 months ago 287.9 MB
hub.c.163.com/public/centos latest 997f0ed97903 13 months ago 441.8 MB
[root@docker_01 ~]# docker run --name ceshi -it centos
Unable to find image 'centos:latest' locally
Trying to pull repository docker.io/library/centos ...
. . . Why is this? I entered by the following method. . .
[root@docker_01 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
98a498cff145 hub.c.163.com/public/centos:6.7-tools "/usr/bin/supervisord" 3 minutes ago Up 3 minutes 22/tcp ceshi_2
[root@docker_01 ~]# sh d.sh 98a498cff145
3396
[root@98a498cff145 ~]# ls
anaconda-ks.cfg d.sh new.file
[root@98a498cff145 ~]# exit
logout
[root@docker_01 ~]# ls
anaconda-ks.cfg d.sh new.file
[root@docker_01 ~]# cat d.sh
#! /bin/bash
PID=$(docker inspect --format "{{.State.Pid}}" $1)
echo $PID
nsenter -t $PID -u -i -n -p
Why are the files in the physical system and the container the same? . . . .
There is no mirror called centos in your REPOSITORY. It’s called hub.c.163.com/public/centos. So he will pull the latest version of centos.
docker run --name ceshi -it hub.c.163.com/public/centos