容器导出为镜像
docker commit container image:v1
镜像导出、上传
docker save -o image.tar image:1.0
docker load -i image.tar
删除容器、镜像
docker rm xxx
docker rmi xxx
删除无效镜像
docker image prune
docker rmi $(docker images -q -f dangling=true)
cp
docker cp 96f7f14e99ab:/var/log/ /tmp/
update
docker update --restart=always f361b7d8465
Dockerfile
docker build -f Dockerfile -t xxx:1.0 .
创建私有仓库
docker pull registry:2
docker run -d -v /opt/registry:/var/lib/registry -p 5000:5000 --name myregistry registry:2
vim /etc/docker/daemon.json
systemctl restart docker.service
上传私有仓库
docker tag nginx:latest localhost:5000/nginx:latest
docker push localhost:5000/nginx:latest
curl -xget http://localhost:5000/v2/_catalog
curl -xget http://localhost:5000/v2/nginx/tags/list
docker compose
docker-compose up -d
docker-compose ps