首页 > 其他分享 >搭建私有镜像仓库

搭建私有镜像仓库

时间:2022-11-17 19:45:37浏览次数:47  
标签:5000 私有 image register 192.168 url 镜像 docker 搭建

目录

杭州阿里 mkmk 仓库

registry.cn-hangzhou.aliyuncs.com/mkmk/all

启动 本地 register server

默认部署的 是 http server, 但是 client 端 是 https 的 ,所以 在 client 端 需要 做一些 配置

docker run -d -p 5000:5000 --restart always --name registry registry

查看 所有仓库

http://192.168.99.100:5000/v2/_catalog

http://registry_ip:5000/v2/nginx/tags/list


http://192.168.111.200:5000/v2/tensorflow/tensorflow/tags/list


http://192.168.99.100:5000/v2/python/tags/list

修改 client 端 配置

## 添加 “ insecure-registries ”

cat >  /etc/docker/daemon.json <<"EOF"

{
  "registry-mirrors": ["https://wm12hkla.mirror.aliyuncs.com"],
  "insecure-registries" : ["192.168.111.200:5000"]
}  +

EOF

systemctl restart docker


测试 本地 register

# 测试 本地镜像 仓库
docker pull nginx
docker tag nginx 192.168.19.10:5000/nginx:new
docker push 192.168.19.10:5000/nginx:new



docker images

docker rmi 192.168.19.10:5000/nginx:new

docker images

docker pull 192.168.19.10:5000/nginx:new


私有 镜像仓库

# sever
docker run -d -p 5000:5000 --restart always --name registry1 registry

for i in 'registry:latest' 'owncloud:10' 
do
j=${i//:/-}
remote_path="registry.cn-hangzhou.aliyuncs.com/mkmk/all:${j}"
docker tag ${i} ${remote_path}
docker push  ${remote_path}
done

# client

cat >  /etc/docker/daemon.json <<"EOF"

{
  "registry-mirrors": ["https://wm12hkla.mirror.aliyuncs.com"],
  "insecure-registries" : ["192.168.111.200:5000"]
}

EOF

systemctl restart docker


register_url='192.168.111.200:5000'
image_url='tensorflow/tensorflow:2.4.1-gpu'

docker pull $image_url
docker tag  $image_url  ${register_url}/$image_url
docker push ${register_url}/$image_url


批量推送镜像

# client

echo 'nameserver 114.114.114.114' > /etc/resolv.conf

register_url='192.168.111.200:5000'
for image_url in 'tensorflow/tensorflow:2.4.1-gpu'  'tensorflow/tensorflow:2.4.1-gpu-jupyter'
do
    docker pull $image_url
    docker tag  $image_url  ${register_url}/$image_url
    docker push ${register_url}/$image_url
done


echo 'nameserver 114.114.114.114' > /etc/resolv.conf

register_url='192.168.111.200:5000'
for image_url in 'nvidia/cuda:11.1.1-devel'  'nvidia/cuda:11.1.1-runtime'
do
    docker pull $image_url
    docker tag  $image_url  ${register_url}/$image_url
    docker push ${register_url}/$image_url
done





gpu

apt install nvidia-driver-450-server -y


docker run -it --gpus=all gpu-burn:cuda11.1


register_url='192.168.111.200:5000'
image_url='gpu-burn:cuda11.1'
docker tag  $image_url  ${register_url}/$image_url
docker push ${register_url}/$image_url


带数据 启动 register

docker run -d -p 5000:5000 --restart always --name registry1 -v  /root/registry:/var/lib/registry   registry


欢迎大家一起交流呀
qq群:3638803451
vx:wxid_sgdelhiwombj12

标签:5000,私有,image,register,192.168,url,镜像,docker,搭建
From: https://www.cnblogs.com/ltgybyb/p/16900559.html

相关文章

  • LNMP架构搭建
       1.Nginx的相关知识 1.1Nginx的简介 1.2 Apache与Nginx的区别1.3 Nginx的进程2.编译安装Nginx服务 2.1.1关闭防火墙,将安装nginx所需软件包传到/op......
  • Centos7 SRS直播服务器搭建
    安装git工具,然后进行安装yum-yinstallgitgitclone-b4.0releasehttps://gitee.com/ossrs/srs.gitcdsrs/trunk./configuremake./objs/srs-cconf/s......
  • Android开发环境的搭建(一)
    开发环境的搭建Android应用程序一般使用Android软件开发工具包,采用Java语言来开发。Android软件开发需要用到的开发工具,如图所示:JDK:相信大家在学习Java语言时,已经......
  • 手把手,完整的从0搭建vite-vue3-ts项目框架:配置less+svg+pinia+vant+axios
    项目同步git:https://gitee.com/lixin_ajax/vue3-vite-ts-pinia-vant-less.git  为避免赘述,过于基础的点会直接省略或贴图,比如创建文件夹/文件的路径/路由一类配置相......
  • K8s集群环境搭建
    K8s集群环境搭建1、环境规划1.1集群类型Kubernetes集群大体上分为两类:一主多从和多主多从一主多从:一台master节点和多台node节点,搭建简单,但是有单机故障风险,适用于......
  • Kubeadm搭建kubernetes集群
    Kubeadm搭建kubernetes集群环境说明|角色|ip|操作系统|组件||–|–|–||master|192.168.203.100|centos8|docker,kubectl,kubeadm,kubelet||node2......
  • LNMP搭建
    一、编译安装Nginx服务1、编译安装Nginx服务的操作步骤systemctlstopfirewalldsystemctldisablefirewalldsetenforce01.1安装依赖包yum-yinstallpcre-d......
  • JAVA环境搭建
      JDK下载   下载链接:https://www.oracle.com/java/technologies/downloads/    如果需要oracle账户,可以找度娘向好心人借一个安装   根据提示进行安装配......
  • 搭建CI环境和git使用
    部署Git+Gerrit+Jenkins的CI环境使用Git作为代码存储及版本控制使用Jenkins进行自动化构建构建测试通过后,再交给人工review人工review通过后,自动同步到远程Git库中。......
  • React-App环境搭建和项目启动
    node环境>=14.0.0npm环境>=5.6安装create-react-app:npmi-gcreate-react-app(cnpm/yarn)创建项目:create-react-appreact-project(项目名称)进入项目根目录:cdreact-p......