zoukankan      html  css  js  c++  java
  • 一步步搭建docker私有仓库并从私有仓库中下载镜像

    • 一步步搭建docker私有仓库
    #下载镜像
    docker pull registry
    #查看镜像 docker images #运行私有仓库,指定端口和数据卷 docker run 
    -d -p 5000:5000 -v /opt/data/registry:/tmp/registry docker.io/registry #-d表示后台运行 -p为端口映射 -v为数据卷挂载,宿主机的/opt/data/registry挂载到容器的/tmp/registry下 #访问私有仓库 curl 192.168.222.128:5000/v1/search #给基础镜像打个标签(前提是mysql镜像存在) docker tag mysql 192.168.222.128:5000/mysql
    #将镜像提交到私有仓库
    docker push
    192.168.222.128:5000/mysql
    #查看镜像存储目录(宿主机上操作)
    tree 
    /opt/data/registry/repositories/
    • 从私有仓库中下载镜像
    # 修改Docker配置文件
    [root@localhost ~]# vim /etc/sysconfig/docker
    # 修改此行
    OPTIONS='--selinux-enabled --insecure-registry 192.168.122.128:5000'        //添加私有仓库地址
    [root@localhost ~]# service docker restart
    Redirecting to /bin/systemctl restart  docker.service

      下载镜像

    docker pull 192.168.222.128:5000/mysql
    • 此外也可以在浏览器中通过http://ip:端口/v1/search
  • 相关阅读:
    Spring的两种代理JDK和CGLIB的区别浅谈
    抽象 工厂模式
    Mybatis总结面试题
    java抽象工厂模式
    java工厂设计模式
    java单例设计模式
    lombok基本使用
    HTML
    select查询操作(重要)五
    mysql的DML语言(需要背下来)(四)
  • 原文地址:https://www.cnblogs.com/rwxwsblog/p/5436739.html
Copyright © 2011-2022 走看看