1.鏡像
1.1創(chuàng)建鏡像
docker pull ubuntu:targe
docker run -it ubuntu:targe /bin/bash
1.2查看鏡像
docker imags
docker tag ubuntu:targe ubuntu:newtarge
docker inspect imageID
1.3搜尋鏡像
docker search ImageName
1.4刪除鏡像
docker rmi -f ubuntu:targe
1.4創(chuàng)建鏡像
docker pull
docker run -ti ubuntu:tag /bin/bash
cat ubuntu-14.04-x86_64.tar.gz | docker import - ubuntu:14.04
1.5存入和載入鏡像
docker save -o ubuntu_14.04.tar.gz ubuntu:14.04
docker load --input ubuntu_14.04.tar.gz
1.6上傳鏡像
docker login
docker push ubuntu:tag
2.容器
2.1新建容器
docker create -it ubuntu:tag
docker run -it ubuntu:tag /bin/bash
2.2終止容器
docker stop containerID
2.3進入容器
docker attach containerID
docker exec -ti containerID
2.4 刪除容器
docker rm containerID
2.5 導(dǎo)入和導(dǎo)出容器
docker export containerID > exportName.tar.gz
cat exportName.tar.gz > docker import - ubuntu:14.04
3.倉庫
3.1創(chuàng)建和使用私用的倉庫
docker run -d -p 5000:5000 registry
docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry