- 安装
uname -r
yum -y install docker
service docker start
docker run hello-world
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://918dbcec.m.daocloud.io
docker version >= 1.12
{"registry-mirrors": ["http://918dbcec.m.daocloud.io"],
"live-restore": true
}
Success.
You need to restart docker to take effect: sudo systemctl restart docker
**
systemctl restart docker.service
**
**docker run hello-world **
- 常用命令
- docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
daocloud.io/library/mysql 5.7 22be5748ecbe 3 weeks ago 405.6 MB
docker.io/hello-world latest 48b5124b2768 10 weeks ago 1.84 kB
-
docker inspect 22be5748ecbe
查看镜像的详细信息 -
docker ps -a
查看容器信息 -
docker rm $(docker ps -aq)
删除容器 -
docker stop 2e3e0aea0dba
关闭容器 - **docker exec -it 775c7c9ee1e1 /bin/bash **
进入容器 -
apt-get update && apt-get -yq install vim
进和容器后,安装vim -
docker rmi 48b5124b2768
删除镜像,删除镜像前,要删除相关的容器 -
docker cp yunmanman_0411.sql f393692f70cb:/sql
宿主机向容器复制文件 -
docker cp f393692f70cb:/sql/ymm0505.sql /alidata
容器向宿主机复制文件
- Docker pull下来的镜像文件、创建出来的容器文件都存在本地的什么地方了?
/var/lib/docker/
http://dockone.io/question/70