zoukankan      html  css  js  c++  java
  • Docker私有仓库的构建

    [root@localhost ~]# vim /etc/sysconfig/docker

    #INSECURE_REGISTRY='--insecure-registry'

    INSECURE_REGISTRY='--insecure-registry 192.168.30.24:5000'

    [root@localhost ~]# systemctl restart docker

    下载镜像

    [root@localhost ~]# docker search -s 100 registry

    [root@localhost ~]# docker pull docker.io/registry

    [root@localhost ~]# mkdir -pv /opt/data/registry

    mkdir: 已创建目录 "/opt/data"

    mkdir: 已创建目录 "/opt/data/registry"

    查看镜像

    [root@localhost ~]# docker images

    REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE

    docker.io/nginx      latest              53f3fd8007f7        4 days ago          109 MB

    docker.io/registry   latest              f32a97de94e1        2 months ago        25.8 MB

    运行容器

    [root@localhost ~]# docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry

    a75135211fb3fc62450fb6e051a9c63b812d2e1c9719ca72ef3e5c48e55f486f

    [root@localhost ~]# docker ps -a

    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS                    NAMES

    a75135211fb3        registry            "/entrypoint.sh /e..."   18 seconds ago      Up 17 seconds               0.0.0.0:5000->5000/tcp   upbeat_gates

    9b38a1021078        docker.io/nginx     "/bin/bash"              2 hours ago         Exited (0) 19 minutes ago                            stoic_goldwasser

    c8931c0b8359        docker.io/nginx     "/bin/bash"              2 hours ago         Exited (0) 19 minutes ago                            kind_booth

    启动容器

    [root@localhost ~]# docker start a7

    a7

    [root@localhost ~]# docker ps

    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES

    a75135211fb3        registry            "/entrypoint.sh /e..."   56 seconds ago      Up 54 seconds       0.0.0.0:5000->5000/tcp   upbeat_gates

    [root@localhost ~]# docker tag nginx 192.168.30.24:5000/nginx-test

    [root@localhost ~]# docker images

    192.168.30.24:5000/nginx-test   latest              53f3fd8007f7        4 days ago          109 MB

    [root@localhost ~]# docker push 192.168.30.24:5000/nginx-test

    在另一台机器然后上传过来

    [root@elk-node2 ~]# docker pull 192.168.30.24:5000/nginx-test

    [root@elk-node2 ~]# docker images

    REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE

    nginx                           new                 db02b5df51bf        24 minutes ago      393 MB

    192.168.30.24:5000/nginx-test   latest              53f3fd8007f7        4 days ago          109 MB

    centos                          7                   9f38484d220f        8 weeks ago         202 MB

    docker.io/centos                latest              9f38484d220f        8 weeks ago         202 MB

  • 相关阅读:
    MySql(六)单表查询
    MySql(五)
    MySql(四)
    MySql(三)
    MySql(二)
    2016高管必看的五大互联网营销方法
    昨日股市暴跌熔断 赵薇亏3.3亿赔惨了(如何预测今年股市走向)
    何炅加入阿里音乐预示“互联网+”三大发展走向
    《老炮儿》的江湖道义就是互联网创业的规矩?
    世界互联网大会三大看点 传递什么信号?
  • 原文地址:https://www.cnblogs.com/zc1741845455/p/10943939.html
Copyright © 2011-2022 走看看