rpm -uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmyum -y install docker-io # This is the only command that can be done;service docker start # Start dockerchkconfig docker on # Join Boot docker pull centos:latest Download CentOS image to local /var/lib/docker/graphdocker images #从docker. Io #查看已下载的镜像docker run -i -t centos /bin/bash #启动一个容器docker imr image_id #删除镜像docker rmi $ (docker images | grep none | awk ' {print $3} ' | sort -r) #删除所有镜像docker ps -a #查看所有容器 (including running and stopped) docker start container # Open a container (note that container_id and image_id are completely different de) docker logs < container name Orid> 2>&1 | grep ' ^user: ' | tail -n1 #查看容器的root用户密码 because the root user's password is randomly assigned when the Docker container starts. Therefore, this way you can get the root user password of the Redmine container docker logs -f < container name orid> #查看容器日志docker rm $ (DOCKER&NBSP;PS&NBSP;-A&NBSP;-Q) #删除所有容 & Delete a single container docker rm < container name Orid >docker run --name redmine -p 9003:80 -p 9023:22 -d -v / var/redmine/files:/redmine/files -v /var/redmine/mysql:/var/lib/mysql Sameersbn/redmine #运行一个新容器, naming it, port mapping, and folder mapping. Take Redmine Mirror as an example docker run -i -t --name sonar -d -link mmysql:db tpires/sonar-server # one container is connected to another container &sonar container is connected to the Mmysql container, and the Mmysql container is renamed to DB. In this way, the sonar container can use the relevant environment variables of DB. #当需要把一台机器上的镜像迁移到另一台机器的时候, you need to save the image and load the image. Machine Adocker save busybox-1 > /home/save.tar use SCP to copy Save.tar to machine B, and then:docker load < /home/save.tardocker build -t < Mirror name > <dockerfile path > #构建自己的镜像
This article is from the Siberian Wolf blog, so be sure to keep this source http://kernal.blog.51cto.com/8136890/1530238