Portus register倉(cāng)庫(kù)使用

#register搭建及使用說(shuō)明

## 1、搭建參考 搭建指導(dǎo)

## 2、使用:由于這個(gè)是個(gè)私有鏡像倉(cāng)庫(kù),所要在其他機(jī)器上使用這個(gè)倉(cāng)庫(kù),需要配置/etc/hosts

```Bash

vim /etc/hosts

172.20.2.93 xxxx.sz.test-portus.com

```

## 3、需要配置dockerd的啟動(dòng)項(xiàng)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服務(wù)

```Bash

systemctl daemon-reload

systemctl restart docker.service

```

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

修改一個(gè)鏡像的tag,使用common-ops賬號(hào)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

```

通過(guò)window可以訪問(wèn)https://xxxx.test-portus.com 頁(yè)面上可以查看到剛剛上傳的鏡像。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 134,837評(píng)論 18 139
  • Docker — 云時(shí)代的程序分發(fā)方式 要說(shuō)最近一年云計(jì)算業(yè)界有什么大事件?Google Compute Engi...
    ahohoho閱讀 15,591評(píng)論 15 147
  • muahao閱讀 2,093評(píng)論 0 3
  • 今天已經(jīng)可以騎平衡車(chē)小跑了,為了和哥哥姐姐們一起騎車(chē)玩的小夢(mèng)想,很努力的練習(xí)。要求我也要一起跑[捂臉](我閨女治好...
    Cathy悅閱讀 266評(píng)論 0 0
  • 時(shí)間過(guò)得太快,許多事還來(lái)不及回味,一直被時(shí)間推著往前走。因而有些想懷念的因?yàn)闆](méi)有時(shí)間就把它存放著讓它發(fā)酵,等哪天突...
    小杰小西閱讀 316評(píng)論 0 0