Docker鏡像上傳到阿里云的步驟詳解
1 安裝Docker運行環(huán)境
參考文檔:https://docs.docker.com或者http://www.dbjr.com.cn/article/94198.htm
2 注冊阿里云賬戶
阿里云官方網站鏈接:https://dev.aliyun.com/search.html
例如:
賬戶:msjtest
密碼:123456
3 登陸賬戶
4 管理Docker Hub鏡像站點:配置Docker加速器
鏈接:https://cr.console.aliyun.com/?spm=5176.1971733.0.2.duOGn4#/accelerator
5 創(chuàng)建鏡像倉庫的命名空間
例如:msj
鏈接:https://cr.console.aliyun.com/?spm=5176.1971733.0.2.duOGn4#/namespace/index
6 創(chuàng)建鏡像倉庫
例如:image-test
鏈接:https://cr.console.aliyun.com/?spm=5176.1971733.0.2.duOGn4#/imageList
7 操作指南
1)登錄阿里云docker registry:
$ sudo dockerlogin --username=msjtest registry.cn-hangzhou.aliyuncs.com
注:登錄registry的用戶名是您的阿里云賬號全名,密碼是開通namespace時設置的密碼。
2)從registry中拉取鏡像:
$ sudo dockerpull registry.cn-hangzhou.aliyuncs.com/msj/image-test:[鏡像版本號]
3)將鏡像推送到registry:
$ sudo dockerlogin --username=mashujie registry.cn-hangzhou.aliyuncs.com $ sudo dockertag [ImageId] registry.cn-hangzhou.aliyuncs.com/msj/image-test:[鏡像版本號] $ sudo dockerpush registry.cn-hangzhou.aliyuncs.com/msj/image-test:[鏡像版本號]
其中[ImageId],[鏡像版本號]請你根據自己的鏡像信息進行填寫。
8 終端執(zhí)行腳本代碼
#登陸命令 $ docker login --username=mashujieregistry.cn-hangzhou.aliyuncs.com #查看主機鏡像 $ docker images #復制鏡像ID并設置tag (或者tag repository:tag) $ docker tag 96eecaf1019a registry.cn-hangzhou.aliyuncs.com/msj/image-test:helloimage01 $ docker tag image01:01registry.cn-hangzhou.aliyuncs.com/msj/image-test:helloimage01 #上傳鏡像到阿里云鏡像倉庫 $ docker pushregistry.cn-hangzhou.aliyuncs.com/msj/image-test:helloimage01
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關文章
gitlab實踐教程使用git config進行相關的配置操作
今天小編就為大家分享一篇關于gitlab實踐教程使用git config進行相關的配置操作,小編覺得內容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2018-12-12Logshark調試Logstash及Filebeat?pipelines使用詳解
這篇文章主要為大家介紹了Logshark調試Logstash及Filebeat?pipelines使用詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-12-12docker Compose部署springboot+vue前端端分離
本文主要介紹了docker Compose部署springboot+vue前端端分離,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2022-08-08Docker打包SpringBoot鏡像的實現(xiàn)方式
docker打包springboot鏡像,并不是簡單的將springboot項目的jar包上傳容器里,然后啟動,這個操作很簡單,但是如果我每次要查看容器中的日志就需要每次都進入容器內部進行查看,這就非常麻煩了,所以本文介紹了Docker打包SpringBoot鏡像的實現(xiàn)方式,需要的朋友可以參考下2024-03-03