• 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、删除私服上的镜像

    目前还没有办法删除镜像

  • 相关阅读:
    spring boot下WebSocket消息推送(转)
    实时Web的发展历史
    mysqldump使用大全
    MYSQLDUMP参数详解(转)
    springboot页面缓存和url缓存实例
    在linux下运行jmeter
    jmeter测试http请求使用csv参数
    maven分开打包jar文件和依赖jar包和资源文件
    log4j DatePattern 解惑
    log4j使用示例
  • 原文地址:https://www.cnblogs.com/puroc/p/5345078.html
Copyright © 2020-2023  润新知