程式語言初學者 Docker 入門第五章 —— Registry 倉庫
集中存放 image 的地方,分成
- 公開
- 私有
💡 Registry 註冊伺服器:存放倉庫
-
Registry
-
Repository
- image
- image
- image
- image
-
Repository
- image
- image
-
Repository
- image
- image
- image
-
Repository
- image
- image
- image
-
Docker Hub
公開映像檔市集
-
登錄
docker login
❯ docker loginLogin 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: chi811008Password:Login SucceededLogging 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/ 搜尋
docker search
❯ docker search python3.12NAME DESCRIPTION STARS OFFICIAL AUTOMATEDnanozoo/python3.12 0kikikanri/python3.12 0darrylwest/python3.12 Python 3.12 build with post-install script t… 0jensdp/python3.12 A vanilla Ubuntu 20 image with python 3.12 a… 0neooz/python3.12 0saltfishy/python3.12 0trestto/python3.12 0adminxt/python3.12 0efenfauzi/python3.12 0kiwidevops/python3.12 python3.12 0freedevorg/python3.12 0zalfrpm/python3.12 0hithats/python3.12-talib python3.12-talib 0qpod0dev/base The image add some basic OS libs and Python3… 0qpod/base The image add some basic OS libs and Python3… 0attojeon/streamlit python3.12 streamlit 1.35 0anujsingh001/anuj-singh-website Portfolio website based on Python3.12, Djang… 0jayfalls/l4t-20.04 Cuda OpenCV, Torch & Tensorrt Ubuntu20.04 do… 0littleatarixe/wine_py wine python3.12 pyinstaller nuitka 0abhijo89/opencv-headless This dockerfile ic created based on python3.… 0hibiscusfly/conda_uwsgi_py3_12_dj_celery_redis ubuntu conda uwsgi python3.12 django celery … 0optai/liboptai-build-test docker image to support python3.12, cmake, g… 0caslaman/cuda-python Installed python3.12 & pip on top of nvidia/… 0dp201090834/python3 jdk11+python3.12+ssh root/123456 023skdu/python312_slim_ml_torch machine learning tools (torch) based on pyth… 0- 下載
docker pull
自動建立
架設本地私有倉庫
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
-
Pull the
ubuntu:16.04
image from Docker Hub.$ docker pull ubuntu:16.04
-
Tag the image as
localhost:5000/my-ubuntu
.First part of the tag is a
hostname
andport
, Docker interprets this as the location of a registry, when pushing.$ docker tag ubuntu:16.04 localhost:5000/my-ubuntu
-
Push the image to the local registry running at
localhost:5000
$ docker push localhost:5000/my-ubuntu
-
Remove the locally-cached
ubuntu:16.04
andlocalhost:5000/my-ubuntu
images$ docker image remove ubuntu:16.04 $ docker image remove localhost:5000/my-ubuntu
-
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
Post a Comment