Portus register仓库使用

#register搭建及使用说明

## 1、搭建参考 搭建指导

## 2、使用:由于这个是个私有镜像仓库,所要在其他机器上使用这个仓库,需要配置/etc/hosts

```Bash

vim /etc/hosts

172.20.2.93 xxxx.sz.test-portus.com

```

## 3、需要配置dockerd的启动项docker.service文件:

```Bash

[Unit]

Description=Docker Application Container Engine

Documentation=https://docs.docker.com

After=network-online.target firewalld.service

Wants=network-online.target

[Service]

Type=notify

# the default is not to use systemd for cgroups because the delegate issues still

# exists and systemd currently does not support the cgroup feature set required

# for containers run by docker

ExecStart=/usr/bin/dockerd --insecure-registry=xxxx.test-portus.com

ExecReload=/bin/kill -s HUP $MAINPID

# Having non-zero Limit*s causes performance problems due to accounting overhead

# in the kernel. We recommend using cgroups to do container-local accounting.

LimitNOFILE=infinity

LimitNPROC=infinity

LimitCORE=infinity

# Uncomment TasksMax if your systemd version supports it.

# Only systemd 226 and above support this version.

#TasksMax=infinity

TimeoutStartSec=0

# set delegate yes so that systemd does not reset the cgroups of docker containers

Delegate=yes

# kill only the docker process, not all processes in the cgroup

KillMode=process

# restart the docker process if it exits prematurely

Restart=on-failure

StartLimitBurst=3

StartLimitInterval=60s

[Install]

WantedBy=multi-user.target

```

k8s集群的话需要修改options:

```Bash

/etc/systemd/system/docker.service.d

vim docker-options.conf 添加需要加入的repo

[Service]

Environment="DOCKER_OPTS=--insecure-registry=10.96.0.0/16 --insecure-registry=xxxx.test-portus.com --graph=/var/lib/docker \

--iptables=true"

```

重启docker服务

```Bash

systemctl daemon-reload

systemctl restart docker.service

```

## 4、本地push 镜像,push到xxxx.test-portus.com/public/路径下;

修改一个镜像的tag,使用common-ops账号xxxx密码登陆registry;

```Bash

docker tag busybox:latest xxxx.test-portus.com/public/busybox:test

docker login -ucommon-ops -pxxxx xxxx.test-portus.com

docker push xxxx.test-portus.com/public/busybox:test

删除

docker rmi xxxx.test-portus.com/public/busybox:test

拉去

docker pull xxxx.test-portus.com/public/busybox:test

```

通过window可以访问https://xxxx.test-portus.com 页面上可以查看到刚刚上传的镜像。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,973评论 19 139
  • Docker — 云时代的程序分发方式 要说最近一年云计算业界有什么大事件?Google Compute Engi...
    ahohoho阅读 15,636评论 15 147
  • muahao阅读 2,097评论 0 3
  • 今天已经可以骑平衡车小跑了,为了和哥哥姐姐们一起骑车玩的小梦想,很努力的练习。要求我也要一起跑[捂脸](我闺女治好...
    Cathy悦阅读 275评论 0 0
  • 时间过得太快,许多事还来不及回味,一直被时间推着往前走。因而有些想怀念的因为没有时间就把它存放着让它发酵,等哪天突...
    小杰小西阅读 323评论 0 0