iT邦幫忙

2021 iThome 鐵人賽

DAY 17
0
DevOps

container & k8s 奏鳴曲系列 第 17

[13th][Day17] docker registry

image 擁有一個公開的 registry 是很方便的,但有時候會想要 build & 儲存 一些比較 private 的 image 時要怎麼做呢?

1.docker dub 上的 Visibility Settings
2.在 Firewall 後方運行自己的 registry

https://ithelp.ithome.com.tw/upload/images/20210925/20119546Yg104mssRP.png

自建一個 registry

docker run -d -p 5000:5000 --restart=always --name registry registry:2.7

https://ithelp.ithome.com.tw/upload/images/20210925/20119546x76zgGp3FK.png

可以 run 起一個 2.7 版本 的 registry container,5000port 綁定本機 5000 port

看看自己有哪些 image

docker images

https://ithelp.ithome.com.tw/upload/images/20210925/201195463w9col5x2l.png

用新的 registry 為我的 image 上 tag

docker tag eric211924/apache:webserver localhost:5000/my-apache

推到自建的 registry container

docker push localhost:5000/my-apache

https://ithelp.ithome.com.tw/upload/images/20210925/201195468GkvCDkkqP.png

把本地的 image 刪乾淨
https://ithelp.ithome.com.tw/upload/images/20210925/20119546F67SaZQrDI.png

https://ithelp.ithome.com.tw/upload/images/20210925/20119546oxkOOIIlnh.png

https://ithelp.ithome.com.tw/upload/images/20210925/20119546W4xramgJFJ.png

run 一個 container by local registry

docker run -it localhost:5000/my-apache bash

https://ithelp.ithome.com.tw/upload/images/20210925/20119546y96vI3ljGv.png


上一篇
[13th][Day16] docker push
下一篇
[13th][Day18] try nginx
系列文
container & k8s 奏鳴曲30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言