zoukankan      html  css  js  c++  java
  • centos6搭建docker镜像私服

    1、创建私服容器

    docker run -d -e SETTINGS_FLAVOR=dev -e STORAGE_PATH=/tmp/registry -v /opt/data/registry:/tmp/registry -p 5000:5000 registry
    

    2、修改/etc/sysconfig/docker配置文件

    如果不修改这个配置文件,则上传镜像时会出现如下错误

    Error: v1 ping attempt failed with error: Get https://192.168.1.230:5000/v1/_ping: dial tcp 192.168.1.230:5000: connection refused. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.1.230:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.1.230:5000/ca.crt
    

    修改之后的配置文件如下:

    other_args="--selinux-enabled --insecure-registry 192.168.1.230:5000"
    

     3、重启docker服务

    service docker restart
    

     4、查看私服上所有的镜像

    curl -X GET http://192.168.1.230:5000/v1/search
    

     5、从官方下载镜像

    docker pull hello-world

    6、给镜像加上标签

    如果不加标签,则上传镜像时会提示没有hello-world这个库

    docker tag hello-world 192.168.1.230:5000/hello-world

    7、上传到私服

    docker push 192.168.1.230:5000/hello-world
    

     8、从私服上下载镜像

    docker pull 192.168.1.230:5000/hello-world
    

     9、删除私服上的镜像

    目前还没有办法删除镜像

  • 相关阅读:
    [算法][递归]求阶乘
    [数据结构]ArrayStack
    [数据结构]Graph
    [数据结构]TrieTree
    [数据结构]UnionFindSet
    [算法]在数组中找到一个局部最小位置
    在二叉树中找到一个节点的后继节点
    [算法]折纸问题
    常用下载方式的区别-BT下载、磁力链接、电驴
    纯文本-FileOutputStream的解码方式
  • 原文地址:https://www.cnblogs.com/puroc/p/5345078.html
Copyright © 2011-2022 走看看