美文网首页kubeflow
kubeflow准备--搭建私有docker仓库

kubeflow准备--搭建私有docker仓库

作者: zoux | 来源:发表于2019-01-06 19:18 被阅读170次

在很多情况下,我们需要使用自己的docker仓库。接下来是在本地k8s集群上搭建本地仓库的过程。
假设我们将本地仓库搭建在k8s主节点上。
这里假设主节点是:192.168.14.84

1.运行registry镜像

docker run -d -p 5000:5000 --restart always --name registry registry:2
直接运行该命令即可,本地没有registry:2,会自动pull

2.修改配置文件

vim /etc/docker/daemon.json
需要改内容为
{
"insecure-registries": [
"192.168.14.84:5000"
]
}

3.重启docker服务

systemctl restart docker

4.验证是否成功

这里的思想是,先下载一个hello-world的镜像,然后修改标签,然后上传到本地服务器上。然后查看服务器是否有该镜像。

4.1 下载镜像,并打标签

docker pull hello-world
docker tag hello-world:latest 192.168.14.84:5000/hello-world:latest

4.2 将本地的192.168.14.84:5000/hello-world:latest镜像上传服务器:

docker push 192.168.14.84:5000/hello-world

4.3 删除本地的192.168.14.84:5000/hello-world:latest,已经hello-world:latest

docker rmi 192.168.14.84:5000/hello-world:latest
docker rmi hello-world:latest

4.4 然后重新拉取看是否成功

docker pull 192.168.14.84:5000/hello-world

查看本地仓库镜像的命令

curl -X GET http://192.168.14.84:5000/v2/_catalog

PS:

以上都是在master节点做的操作,要想在其他node节点上也能使用本地仓库,需要在其他节点进行步骤2的操作,修改/etc/docker/daemon.json文件。文件内容和上述一样。

相关文章

  • kubeflow准备--搭建私有docker仓库

    在很多情况下,我们需要使用自己的docker仓库。接下来是在本地k8s集群上搭建本地仓库的过程。假设我们将本地仓库...

  • Docker

    构建镜像仓库 Docker运行java程序 1.1.6 搭建docker私有仓库 新建私有仓库 1.2.1 数据挂...

  • 5.私有与公有镜像仓库

    一. 搭建私有镜像仓库 Docker Hub作为Docker默认官方公共镜像;如果想自己搭建私有镜像仓库,官方也提...

  • Docker

    一、Docker 私有仓库搭建 环境centos 6 192.168.1.2 Docker 仓库 192.168....

  • k8s学习笔记-5-私有harbor

    5 创建docker私有仓库 使用node5节点搭建harbor私有仓库 harbor仓库依赖docker和doc...

  • Docker搭建私有仓库之Harbor

    Docker搭建私有仓库之Harbor Harbor Harbor是构建企业级私有docker镜像的仓库的开源解决...

  • Docker之八私有仓库

    个人专题目录 Docker 私有仓库 1. 私有仓库搭建 2. 将镜像上传至私有仓库 3. 从私有仓库拉取镜像

  • Centos7利用Harbor2.3.0搭建自己的私有镜像仓库

    搭建私有镜像仓库和利于团队开发和运维,搭建方式有两种。 准备工作 安装docker 设置仓库 sudo yum i...

  • 搭建docker私有仓库(3)

    至于为什么搭建docker私有仓库,原因很简单,把项目放到docker公有仓库,或者是阿里云的docker仓库,是...

  • Docker私有仓库

    一、Docker私有仓库搭建与配置 1、拉取私有仓库镜像 2、启动私有仓库容器 3、打开浏览器输入地址http:/...

网友评论

    本文标题:kubeflow准备--搭建私有docker仓库

    本文链接:https://www.haomeiwen.com/subject/ttxerqtx.html