zoukankan      html  css  js  c++  java
  • CentOS搭建Docker Hub私有仓库

    docker pull registry
    拉取registry镜像

    docker images
    查看镜像

    docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry
    启动容器

    Registry服务默认将仓库存放于容器内的/tmp/registry目录下,
    这样如果容器被删除,
    则存放于容器中的镜像也会丢失,
    所以我们一般情况下会指定本地一个目录挂载到容器内的/tmp/registry下

    sudo docker ps -a
    查看容器

    firewall-cmd --zone=public --permanent --add-port=5000/tcp
    firewall-cmd --reload
    开启防火墙5000端口

    访问
    http://192.168.1.6:5000/v2/

    docker tag hello-world localhost:5000/2018
    为hello-world镜像添加一个新的localhost:5000/2018标签

    docker push localhost:5000/2018
    把localhost:5000/2018镜像推送到私有仓库

    访问
    http://192.168.1.6:5000/v2/_catalog


    docker rmi hello-world localhost:5000/2018
    把本地的hello-world与localhost:5000/2018这2个镜像都删掉

    docker pull localhost:5000/2018
    从私有仓库里拉取localhost:5000/2018镜像

    docker images
    此时再查看镜像

  • 相关阅读:
    开开心心
    HOW HE/SHE'S SEEN
    天池
    sql server deadlock跟踪的四种方法
    reduce 好东西
    object方法
    页面横向滚动 联动 进度条
    浅拷贝、深拷贝
    图片下载
    axios简单封装
  • 原文地址:https://www.cnblogs.com/yjlch1016/p/9028811.html
Copyright © 2011-2022 走看看