• 6.docker的私用镜像仓库registry


    docker方式启动镜像仓库

    / # cat /etc/docker/registry/config.yml 
    version: 0.1
    log:
      fields:
        service: registry
    storage:
      cache:
        blobdescriptor: inmemory
      filesystem:
        rootdirectory: /var/lib/registry
    http:
      addr: :5000
      headers:
        X-Content-Type-Options: [nosniff]
    health:
      storagedriver:
        enabled: true
        interval: 10s
        threshold: 3
    / # [root@localhost ~]# docker run -it --rm --name jj registry:2 /bin/sh

    配置 TLS 证书

    当本地主机运行 Registry 服务后,所有能访问到该主机的 Docker Host 都可以把它作为 私有仓库使用,只需要在镜像名称前面添加上具体的服务器地址即可。 例如将本地的nginx 推入自己的仓库

    私有仓库需要启用 TLS 认证,否则会报错。 在第一部分中,我们介绍了通过添加 DOCKER_ OPTS="--insecure-registry  yourhostname:5000"  (此版本下的docker没有这个硬性要求)

    [root@localhost ~]# docker version 
    Client:
     Version:           18.09.3
     API version:       1.39
     Go version:        go1.10.8
     Git commit:        774a1f4
     Built:             Thu Feb 28 06:33:21 2019
     OS/Arch:           linux/amd64
     Experimental:      false
    
    Server: Docker Engine - Community
     Engine:
      Version:          18.09.3
      API version:      1.39 (minimum version 1.12)
      Go version:       go1.10.8
      Git commit:       774a1f4
      Built:            Thu Feb 28 06:02:24 2019
      OS/Arch:          linux/amd64
      Experimental:     false

    推拉镜像

    docker images
    docker  tag nginx:alpine localhost:5000/nginx/alpine
    docker push localhost:5000/nginx/alpine
  • 相关阅读:
    HTTP/2的优先级
    JavaScript 日期权威指南
    岂曰无衣与子同袍
    Android项目中实现native调用
    关键渲染路径
    @ModelAttribute使用详解
    @SessionAttribute使用详解
    @ControllerAdvice 拦截异常并统一处理
    js获取文件MD5值
    Mybatis分页插件PageHelper的配置和使用方法
  • 原文地址:https://www.cnblogs.com/leleyao/p/10499302.html
Copyright © 2020-2023  润新知