美文网首页程序员
docker打包镜像并发布

docker打包镜像并发布

作者: 北冥摸鱼 | 来源:发表于2022-04-06 17:47 被阅读0次

使用docker commit命令打包容器为镜像

//docker commit 容器名称 镜像名称:标签名称
  docker commit ubuntu20 123456789/ubuntu:ubuntu20.04-php7.4-myqsl8-nginx
  sha256:e16c769ccba5fea85aab236b8898d05c455b322d718b4471f6df0c2729f16922

docker login 123456789@qq.com登录docker账号,根据提示输入密码

//根据提示输入账号和密码
PS C:\Users\Administrator> docker login 123456789@qq.com
Authenticating with existing credentials...
Login Succeeded

docker images查看本地镜像

PS C:\Users\Administrator> docker images
REPOSITORY                        TAG                               IMAGE ID       SIZE
ubuntu20.04/php7.4/mysql8         lnmp                              b55842d22356   1.22GB
hyperf/hyperf                     7.4-alpine-v3.11-swoole           8d212062446b   124MB

docker tag b5584 123456789/ubuntu:ubuntu20.04-php7.4-myqsl8创建新标签

//docker tag 镜像ID docker账号/存储库:标签名称
  docker tag b5584 123456789/ubuntu:ubuntu20.04-php7.4-myqsl8

docker push 123456789/ubuntu:ubuntu20.04-php7.4-myqsl8-nginx推送标签到存储库,提示成功后到ubuntu存储库

//docker push docker账号/存储库:标签名称
  docker push 123456789/ubuntu:ubuntu20.04-php7.4-myqsl8-nginx

相关文章

网友评论

    本文标题:docker打包镜像并发布

    本文链接:https://www.haomeiwen.com/subject/tqirsrtx.html