主题
Docker 镜像(Image)
只读模板,用于创建容器。通常来自 Registry 或本地 Dockerfile 构建。
高频命令
bash
docker image pull nginx:latest
docker image ls
docker image build -t my-app:latest .
docker image tag my-app:latest registry.example.com/my-app:1.0
docker image push registry.example.com/my-app:1.0
docker image rm my-app:latest
docker image prune -af备份 / 恢复
bash
docker tag xxx:latest xxx:2.7.2
docker save -o xxx_2.7.2_backup.tar xxx:2.7.2
docker load -i xxx_2.7.2_backup.tar