Docker - 命令

docker login  登录账号

docker build -t wjlmgqs/mtdelog .  构建镜像

docker run wjlmgqs/mtdelog 运行镜像

docker push wjlmgqs/mtdelog 上传镜像

docker commit -m "说明信息" -a "作者信息" 容器ID 仓库:标签

docker images  查看新生成的镜像

示例

#提交容器ID为镜像(会更新镜像)
docker commit -m "mysql5.7" -a "wjlmgqs" 367b1240329c wjlmgqs/mtdelog-mysql:1.0 
docker commit -m "minio" -a "wjlmgqs" 24129c3bc0ba wjlmgqs/mtdelog-minio:1.0
docker commit -m "nginx" -a "wjlmgqs" 5dd3713db10b wjlmgqs/mtdelog-nginx:1.0
docker commit -m "redis" -a "wjlmgqs" bfaad7255955 wjlmgqs/mtdelog-redis:1.0
docker commit -m "rabbitmq management" -a "wjlmgqs" bc6cdd185cfd wjlmgqs/mtdelog-rabbitmq:1.0

#保存到服务端
docker push wjlmgqs/mtdelog-minio:1.0
docker push wjlmgqs/mtdelog-mysql:1.0
docker push wjlmgqs/mtdelog-nginx:1.0
docker push wjlmgqs/mtdelog-redis:1.0
docker push wjlmgqs/mtdelog-rabbitmq:1.0

#镜像打标签或改(可选)
#docker tag 镜像ID 镜像名字:版本
docker tag 3533e8c965c5 wjlmgqs/mtdelog-minio:1.0
docker tag b3ea542dcce7 wjlmgqs/mtdelog-mysql:1.0
docker tag 13a3667f63e1 wjlmgqs/mtdelog-nginx:1.0
docker tag e3f2f3725506 wjlmgqs/mtdelog-redis:1.0
docker tag 36a6a8aee125 wjlmgqs/mtdelog-rabbitmq:1.0

#构建打包(可选)(根据Dockerfile配置来构建)
docker build -t wjlmgqs/mtdelog-minio:1.0 .
docker build -t wjlmgqs/mtdelog-mysql:1.0.0 .
docker build -t wjlmgqs/mtdelog-nginx:1.0 .
docker build -t wjlmgqs/mtdelog-redis:1.0 .
docker build -t wjlmgqs/mtdelog-rabbitmq:1.0 .


#删除指定名称的镜像
docker rmi --force `docker images | grep 'none' | awk '{print $3}'`

你可能感兴趣的:(docker,java,容器)