Build:
# 进入 Dockerfile 所在目录
docker build -t myimg .
Pull:
docker search ubuntu
docker pull ubuntu:latest
Run:
docker images
docker run -it <image_id> [/bin/bash]
#..
#..
#..
#exit
docker ps -a
docker commit <container_id> myimg
Push:
step1——找到本地镜像的ID:docker images
step2——登陆Hub:docker login --username=username --password=password --email=email
step3——tag:docker tag <imageID> <namespace>/<image name>:<version tag eg latest>
step4——push镜像:docker push <namespace>/<image name>
镜像导出和导入
docker save chrisgeorge/centos6.6-py2.6 >/root/docker-pmd.tar
docker load < /root/docker-pmd.tar
容器导出和导入
docker export container_id > ubuntu.tar
cat ubuntu.tar | docker import - taojy123/ubuntu:v1.0