---
# System prepended metadata

title: PhotonOS 設定私有的 Harbor Registry
tags: [private registry, Documentation, Docker, Public, PhotonOS, Harbor]

---

---
title: 'PhotonOS 設定私有的 Harbor Registry'
disqus: hackmd
---

PhotonOS 設定私有的 Harbor Registry
===
參考來源: https://www.vmtocloud.com/how-to-use-photonos-with-an-insecure-registry/

## 索引

[TOC]

## 注意事項

* 此部分主要是為了可以在PhotonOS的Docker上使用來自私有Registry的鏡像
* 設定Docker login至安裝的Harbor(非https)

## 流程

```plantuml
:設定目標Private-Registry來源;
:重啟Docker服務;
:測試驗證登入結果;
```

### 設定目標Private-Registry來源
![](https://i.imgur.com/CapgGCs.png)
在這裡採用Harbor為例，並將Private Registry設定為Harbor: harbor.b30f.systex.com:80 (非https 443)

### 重啟Docker服務
![](https://i.imgur.com/nMXfx7r.png)
```bash
systemctl daemon-reload
systemctl restart docker
```

### 測試驗證登入結果
```bash
docker login harbor.b30f.systex.com:80
```
如果有顯示login success就可以正常使用Image在local

## 額外測試

### 離線的Image封包測試
![](https://i.imgur.com/B0z5j7d.png)

## Reference and FAQ

* [how-to-use-photonos-with-an-insecure-registry](https://www.vmtocloud.com/how-to-use-photonos-with-an-insecure-registry/)
* [deploy-insecure-private-docker-registry](https://blog.txstudio.tw/2017/08/deploy-insecure-private-docker-registry.html)
* [docker save](https://docs.docker.com/engine/reference/commandline/save/)
* [docker load](https://docs.docker.com/engine/reference/commandline/load/)
* [registry/insecure](https://docs.docker.com/registry/insecure/)
* [docker-registry-insecure-registry-not-working](https://stackoverflow.com/questions/38581414/docker-registry-insecure-registry-not-working)

:::info
**Find this document incomplete?** Leave a comment!
:::

###### tags: `Public` `PhotonOS` `Docker` `Harbor` `private registry` `Documentation`
