.0.222:5000/myhello:1.0.0
发布时间:2025-06-24 19:52:01 作者:北方职教升学中心 阅读量:295
ps。构建镜像并贴上仓库标签,
注意将仓库地址替换为实际IP或域名。仓库为空。-p。
检查仓库是否存在。
docker。192.168。=always。.0.221:5000/myhello:1.0.1。 检查命令是否可用。 构建镜像上传的Docker。registry。 说话。添加以下内容。 .0.222:5000/myhello:1.0.0。images。 -d。 将镜像推送到私人仓库。检查运行状态。
准备构建镜像内容。"192.168.0.222:5000"]。|。
pull。registry.2.8.3.tar。/data/docker-registry开始仓库。
{。.0.222:5000/myhello:1.0.0。例如:
重启Docker。-p。 请确保私人仓库已添加到containerd目录详见 [5]。
build。
docker。。load。cd。-t。。
下载离线镜像。<< EOFFROM scratch COPY ./file.txt file.txtEOF。
检查Docker环境。registry.2.8.3.tar。
~。 -o。.。
systemctl restart。
docker。 .0.221:5000/myhello:1.0.1。version。 -v。"insecure-registries":。
[5]. 小灰灰的碎念 . containerd 配置私有仓库 . 2023.11 . https://h2c.tech/p/containerd-配置私有仓库/。创建镜像存储路径。.0.1:5000/v2/_catalog。hello_world/。image save registry:2.8.3。registry。hello_world。。<< EOFFROM scratch COPY ./file.txt file.txtEOF。 192.168。
[2]. yeasy . docker——入门到实践 . https://yeasy.gitbook.io/docker_practice/repository/registry。
docker。push。docker。 .0.222:5000/myhello:1.0.0。推送成功。pull registry:2.8.3.

离线导出,在无法连接的设备上安装方便。

nerdctl push。从另一台设备上从私人仓库拉出镜像。registry:2.8.3.服务端口为。

curl。/data/docker-registry/:/var/lib/registry。

docker。hello_world/。grep。
127.0。
复制到目标设备,操作下面的命令导入镜像。

准备构建镜像内容。
[3]. 博客园 . 持久docker镜像或容器的方法 . 飞天小子 . 2018.12 . https://www.cnblogs.com/zhuochong/p/10064350.html。registry.2.8.3.tar。.0.1:5000/v2/_catalog。 需要映射主机存储目录,

Docker Hub 中registry 最新版本为 2.8.3,详见 registry . https://hub.docker.com/_/registry/tags。Containerd构建镜像上传。
docker。

在需要访问私人仓库的设备上,调整Docker配置文件。 推到私人仓库。>Dockerfile。检查服务是否可访问:

curl。镜像存储目录为
/var/lib/registry。防止容器删除后镜像丢失。-t。run。}。 !nerdctl build。192.168。\。

用Containerd构建镜像需要先安装 nerdctl [6]。.。 192.168。

离线安装。 -i。 --restart。 5000。192.168。
cd。mkdir。 --name。
下载镜像。
docker。参考文献。

启动。cd。
设置私有仓库。
docker。-p。nerdctl。touch。构建镜像并贴上仓库标签,
注意将仓库地址替换为实际IP或域名。
curl。>Dockerfile。
~。
docker。
-v。
- 5000 注意打开防护墙。
导入镜像进行查询。
http://192.168.0.221:5000/v2/myhello/tags/list。hello_world。[。
cd。 !docker。
/etc/docker/daemon.json。mkdir。file.txt。-p。
[1]. CNCF . Distribution Registry . 2024 . https://distribution.github.io/distribution/。cat。
[6]. 博客园 . 安装nerdctl . 小吉猫 2022.10 . https://www.cnblogs.com/wangguishe/p/16779282.html。cat。:5000。file.txt。127.0。
[4]. containerd . nerdctl . 2024 .https://github.com/containerd/nerdctl。检查仓库上的镜像。mkdir。touch。