程式語言初學者 Docker 入門第五章 —— Registry 倉庫

 集中存放 image 的地方,分成

  • 公開
  • 私有

💡 Registry 註冊伺服器:存放倉庫

  • Registry

    • Repository

      • image
      • image
      • image
      • image
    • Repository

      • image
      • image
    • Repository

      • image
      • image
      • image
    • Repository

      • image
      • image
      • image

Docker Hub

公開映像檔市集

  1. 登錄 docker login

    ❯ docker login
    Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
    Username: chi811008
    Password:

    Login Succeeded

    Logging in with your password grants your terminal complete access to your account.
    For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/
  2. 搜尋 docker search

    ❯ docker search python3.12
    NAME DESCRIPTION STARS OFFICIAL AUTOMATED
    nanozoo/python3.12 0
    kikikanri/python3.12 0
    darrylwest/python3.12 Python 3.12 build with post-install script t… 0
    jensdp/python3.12 A vanilla Ubuntu 20 image with python 3.12 a… 0
    neooz/python3.12 0
    saltfishy/python3.12 0
    trestto/python3.12 0
    adminxt/python3.12 0
    efenfauzi/python3.12 0
    kiwidevops/python3.12 python3.12 0
    freedevorg/python3.12 0
    zalfrpm/python3.12 0
    hithats/python3.12-talib python3.12-talib 0
    qpod0dev/base The image add some basic OS libs and Python3… 0
    qpod/base The image add some basic OS libs and Python3… 0
    attojeon/streamlit python3.12 streamlit 1.35 0
    anujsingh001/anuj-singh-website Portfolio website based on Python3.12, Djang… 0
    jayfalls/l4t-20.04 Cuda OpenCV, Torch & Tensorrt Ubuntu20.04 do… 0
    littleatarixe/wine_py wine python3.12 pyinstaller nuitka 0
    abhijo89/opencv-headless This dockerfile ic created based on python3.… 0
    hibiscusfly/conda_uwsgi_py3_12_dj_celery_redis ubuntu conda uwsgi python3.12 django celery … 0
    optai/liboptai-build-test docker image to support python3.12, cmake, g… 0
    caslaman/cuda-python Installed python3.12 & pip on top of nvidia/… 0
    dp201090834/python3 jdk11+python3.12+ssh root/123456 0
    23skdu/python312_slim_ml_torch machine learning tools (torch) based on pyth… 0
  3. 下載 docker pull
  4. 自動建立

架設本地私有倉庫

login 以後

Run a local registry

Use a command like the following to start the registry container:

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

The registry is now ready to use.

Copy an image from Docker Hub to your registry

  1. Pull the ubuntu:16.04 image from Docker Hub.

    $ docker pull ubuntu:16.04
    
  2. Tag the image as localhost:5000/my-ubuntu.

    First part of the tag is a hostname and port, Docker interprets this as the location of a registry, when pushing.

    $ docker tag ubuntu:16.04 localhost:5000/my-ubuntu
    
  3. Push the image to the local registry running at localhost:5000

    $ docker push localhost:5000/my-ubuntu
    
  4. Remove the locally-cached ubuntu:16.04 and localhost:5000/my-ubuntu images

    $ docker image remove ubuntu:16.04
    $ docker image remove localhost:5000/my-ubuntu
    
  5. test- pull the localhost:5000/my-ubuntu image from local registry

    $ docker pull localhost:5000/my-ubuntu
    

Stop a local registry

To stop the registry, use the same docker container stop command as with any other container.

$ docker container stop registry

To remove the container, use docker container rm.

$ docker container stop registry && docker container rm -v registry

Comments

Popular posts from this blog

《 Imgproxy 使用分析一:圖片下載速度優化分析:Akamai CDN vs Imgproxy 效能比較》

《 Akamai + S3 與 CloudFront + Imgproxy + S3 使用分析二:壓縮圖片設計流程:檔案大小 vs 載入時間的權衡》

程式語言初學者 Docker 入門第二章 —— 安裝與驗證 (Mac)