上傳 Image 到 Registry

  1. 連線 registry,查看 images,回應不允許無認證存取。
    [root@registry ~]# curl https://registry.csie.cyut.edu.tw/v2/_catalog
    {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":
    [{"Type":"registry","Class":"","Name":"catalog","Action":"*"}]}]}
    podman login -uadmin -pxxxxxx https://registry.csie.cyut.edu.tw
    
  2. 使用帳號 admin 查詢 registry.csie.cyut.edu.tw,repositories 中沒有任何的 image。
    [root@registry ~]# curl -u admin:xxxxxx https://registry.csie.cyut.edu.tw/v2/_catalog
    {"repositories":[]}
    
  3. 下載 docker.io/library/hello-world。
    [root@registry ~]# podman pull docker.io/library/hello-world
    Trying to pull docker.io/library/hello-world...
    Getting image source signatures
    Copying blob 0e03bdcc26d7 [--------------------------------------] 0.0b / 0.0b
    Copying config bf756fb1ae done  
    Writing manifest to image destination
    Storing signatures
    bf756fb1ae65adf866bd8c456593cd24beb6a0a061dedf42b26a993176745f6b
    
  4. 查詢本地端 images,出現 docker.io/library/hello-world。
    [root@registry ~]# podman images
    REPOSITORY                     TAG     IMAGE ID      CREATED        SIZE
    docker.io/library/registry     latest  2d4f4b5309b1  5 months ago   26.8 MB
    docker.io/library/hello-world  latest  bf756fb1ae65  11 months ago  20 kB
    
  5. 登入 https://registry.csie.cyut.edu.tw
    [root@registry ~]# podman login -uadmin -pxxxxxx https://registry.csie.cyut.edu.tw
    Login Succeeded!
    
  6. 上傳本地端的 docker.io/library/hello-world 到 https://registry.csie.cyut.edu.tw,且命名為 hello。
    [root@registry ~]# podman push hello-world registry.csie.cyut.edu.tw/hello
    Getting image source signatures
    Copying blob 9c27e219663c done  
    Copying config bf756fb1ae done  
    Writing manifest to image destination
    Storing signatures
    
  7. 再查詢 registry.csie.cyut.edu.tw,repositories 中出現 hello 的 image。
    [root@registry ~]# curl -u admin:xxxxxx https://registry.csie.cyut.edu.tw/v2/_catalog
    {"repositories":["hello"]}
    
  8. 下載 docker.io/voxxit/rsyslog。
    [root@registry ~]# podman pull docker.io/voxxit/rsyslog
    Trying to pull docker.io/voxxit/rsyslog...
    Getting image source signatures
    Copying blob 1eae7a7426b0 done  
    Copying blob e6ff9ca2051f done  
    Copying blob 0db111ab9ef6 done  
    Copying blob d97f592f5e1e done  
    Copying config 8411a1edd4 done  
    Writing manifest to image destination
    Storing signatures
    8411a1edd4bb97aeae6bf9124cb00c66ff577ae68848e50704e9157263127aeb
    
  9. 查詢本地端 images,出現 docker.io/voxxit/rsyslog。
    [root@registry ~]# podman images
    REPOSITORY                     TAG     IMAGE ID      CREATED        SIZE
    docker.io/library/registry     latest  2d4f4b5309b1  5 months ago   26.8 MB
    docker.io/library/hello-world  latest  bf756fb1ae65  11 months ago  20 kB
    docker.io/voxxit/rsyslog       latest  8411a1edd4bb  2 years ago    20 MB
    
  10. 上傳本地端的 docker.io/voxxit/rsyslog 到 https://registry.csie.cyut.edu.tw,且命名為 rsyslog。
    [root@registry ~]# podman push rsyslog registry.csie.cyut.edu.tw/rsyslog
    Getting image source signatures
    Copying blob 22ff8195a9d5 done  
    Copying blob c9e8b5c053a2 done  
    Copying blob 36da72a6f23e done  
    Copying blob 9bc4ee67fdda done  
    Copying config 8411a1edd4 done  
    Writing manifest to image destination
    Storing signatures
    
  11. 再查詢 registry.csie.cyut.edu.tw,repositories 中除了 hello,還有 rsyslog 。
    [root@registry ~]# curl -u admin:xxxxxx https://registry.csie.cyut.edu.tw/v2/_catalog
    {"repositories":["hello","rsyslog"]}
    
  12. 上傳本地端的 localhost/dywrsyslog 到 https://registry.csie.cyut.edu.tw,且命名為 dywrsyslog。
    [root@registry ~]# podman push localhost/dywrsyslog registry.csie.cyut.edu.tw/dywrsyslog
    Getting image source signatures
    Copying blob 16759751ab17 done  
    Copying blob 22ff8195a9d5 skipped: already exists  
    Copying blob 9bc4ee67fdda skipped: already exists  
    Copying blob c9e8b5c053a2 skipped: already exists  
    Copying blob 36da72a6f23e skipped: already exists  
    Copying config ce4e2bdc8a done  
    Writing manifest to image destination
    Storing signatures