# Nexus 相關

# Nexus 3 Docker倉庫（hosted、proxy、group）模式解說

出處：https://www.cnblogs.com/yjbjingcha/p/8308973.html

Nexus作為私庫管理最受歡迎的工具之中的一個，用於套件的管理和Docker映像管理的私庫管理場景中非經常常使用。 Easypack利用最新版本號的oss版Nexus作為基礎鏡像來提供相似服務。

本文將同一時候給出具體步驟結合最新發行的Docker-CE版本號實現鏡像私庫的管理。

# Why Nexus 3

這裡整理了為什麼使用Nexus 3的一些理由，在做選型的時候能夠做一個簡單參照。

<div id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94-%E7%82%BA%E4%BB%80%E9%BA%BC%E8%A6%81%E4%BD%BF%E7%94%A8nexus-3-"><div><table><thead><tr><th>專案</th><th>具體</th></tr></thead><tbody><tr><td>為什麼要使用Nexus 3</td><td>[http://blog.csdn.net/liumiaocn/article/details/62050525](http://blog.csdn.net/liumiaocn/article/details/62050525)</td></tr></tbody></table>

</div></div># docker版本號

本次使用的docker的版本號為17.03.0-ce，可是應該不限於此版本號，其它版本號未作驗證。

```
[root@liumiaocn ~]# docker version
Client:
 Version:      17.03.0-ce
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 08:10:07 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.0-ce
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 08:10:07 2017
 OS/Arch:      linux/amd64
 Experimental: false
[root@liumiaocn ~]#
```

# 下載鏡像

```
[root@liumiaocn ~]# docker pull liumiaocn/nexus
Using default tag: latest
latest: Pulling from liumiaocn/nexus
Digest: sha256:b93f9a6bba2b35ada33c324cd06bd2c732fc1bed352df186af1a013e228af8d8
Status: Image is up to date for liumiaocn/nexus:latest
[root@liumiaocn ~]#
```

# 啟動Nexus

<table id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94-nexus-ui-8081-" style="height: 151px;"><thead><tr style="height: 29px;"><th style="height: 29px; width: 94.4375px;">專案</th><th style="height: 29px; width: 193.703px;">具體</th></tr></thead><tbody><tr style="height: 29px;"><td style="height: 29px; width: 94.4375px;">Nexus UI</td><td style="height: 29px; width: 193.703px;">8081</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 94.4375px;">private repo</td><td style="height: 29px; width: 193.703px;">8082</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 94.4375px;">proxy repo</td><td style="height: 29px; width: 193.703px;">8083</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 94.4375px;">URL</td><td style="height: 35px; width: 193.703px;">[http://192.168.32.123:8081/](http://192.168.32.123:8081/)</td></tr></tbody></table>

```
[root@liumiaocn ~]# docker run -d -p 8081:8081 -p 8082:8082 -p 8083:8083 --name nexus liumiaocn/nexus
222abae47fcf9d32c821bff6426edd03f6757a3dd4cbe07517dada5d800e173f
[root@liumiaocn ~]#
```

# logon

<table id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94-url-http%3A%2F%2F192" style="height: 122px;"><thead><tr style="height: 29px;"><th style="height: 29px; width: 120.953px;">專案</th><th style="height: 29px; width: 193.703px;">具體</th></tr></thead><tbody><tr style="height: 35px;"><td style="height: 35px; width: 120.953px;">URL</td><td style="height: 35px; width: 193.703px;">[http://192.168.32.123:8081/](http://192.168.32.123:8081/)</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 120.953px;">username稱</td><td style="height: 29px; width: 193.703px;">admin</td></tr><tr style="height: 29px;"><td style="height: 29px; width: 120.953px;">使用者password</td><td style="height: 29px; width: 193.703px;">admin123</td></tr></tbody></table>

[![image-1733280055752.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/QRq1TNlZw1hWExWX-image-1733280055752.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/QRq1TNlZw1hWExWX-image-1733280055752.png)

登陸後

[![image-1733280091016.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/G29WypfBZaAYXrr8-image-1733280091016.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/G29WypfBZaAYXrr8-image-1733280091016.png)

# 倉庫類型

具體倉庫類型主要分為hosted/proxy/group三種。

具體含義例如以下：

<div id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94%E8%AA%AA%E6%98%8E-hosted-%E6%9C%AC%E5%9C%B0%E5%84%B2%E5%AD%98%E3%80%82"><div><table><thead><tr><th>專案</th><th>具體說明</th></tr></thead><tbody><tr><td>hosted</td><td>本地儲存。像官方倉庫一樣提供本地私庫功能</td></tr><tr><td>proxy</td><td>提供代理其它倉庫的類型</td></tr><tr><td>group</td><td>群組類型，能夠組合多個倉庫為一個位址提供服務</td></tr></tbody></table>

</div></div># 建立priavete倉庫

建立一個Hosted的倉庫作為private倉庫，具體設定資訊例如以下：

<div id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94%E8%AA%AA%E6%98%8E-%E9%A1%9E%E5%9E%8B-docker-%28h"><div><table><thead><tr><th>專案</th><th>具體說明</th></tr></thead><tbody><tr><td>類型</td><td>docker (hosted)</td></tr><tr><td>Name</td><td>docker-repo-private</td></tr><tr><td>HTTP Port</td><td>8082</td></tr><tr><td>Blob store</td><td>docker-repo-private</td></tr><tr><td>Deployment policy</td><td>Allow redeploy</td></tr></tbody></table>

</div></div>[![image-1733280146393.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/j03IVMQxO5guwiwq-image-1733280146393.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/j03IVMQxO5guwiwq-image-1733280146393.png)

# 建立proxy倉庫

建立一個proxy倉庫。具體設定資訊例如以下：

<div id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94%E8%AA%AA%E6%98%8E-%E9%A1%9E%E5%9E%8B-docker-%28p"><div><table><thead><tr><th>專案</th><th>具體說明</th></tr></thead><tbody><tr><td>類型</td><td>docker (proxy)</td></tr><tr><td>Name</td><td>docker-repo-proxy</td></tr><tr><td>Location of the remote repository being proxied</td><td>[https://registry-1.docker.io](https://registry-1.docker.io/)</td></tr><tr><td>Docker Index</td><td>Use Docker Hub</td></tr><tr><td>Blob store</td><td>docker-repo-proxy</td></tr></tbody></table>

</div></div>[![image-1733280211579.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/auBxhCsthRjsdHKb-image-1733280211579.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/auBxhCsthRjsdHKb-image-1733280211579.png)

# 建立group倉庫<button aria-expanded="false" class="cnblogs-toc-button" title="顯示目錄導航"></button>

建立一個group倉庫。具體設定資訊例如以下：

<div id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94%E8%AA%AA%E6%98%8E-%E9%A1%9E%E5%9E%8B-docker-%28g"><div><table><thead><tr><th>專案</th><th>具體說明</th></tr></thead><tbody><tr><td>類型</td><td>docker (group)</td></tr><tr><td>Name</td><td>docker-repo-group</td></tr><tr><td>HTTP Port</td><td>8083</td></tr><tr><td>Blob store</td><td>docker-repo-group</td></tr><tr><td>Member repositories</td><td>docker-repo-private</td></tr><tr><td>Member repositories</td><td>docker-repo-proxy</td></tr></tbody></table>

</div></div>[![image-1733280254164.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/ryWgtsEoqw1lgUTy-image-1733280254164.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/ryWgtsEoqw1lgUTy-image-1733280254164.png)

# docker設定

Docker的私庫能夠使用HTTP或HTTPS。 Nexus 3都予以支持。本文的方式採用HTTP方式。因此須要設定docker。在docker啟動前設定例如以下資訊是須要的

<div id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94%E8%AA%AA%E6%98%8E-%E8%A8%AD%E5%AE%9A%E7%89%A9%E4%BB%B6%E6%96%87%E4%BB%B6-%2Fetc%2F"><table><thead><tr><th>專案</th><th>具體說明</th></tr></thead><tbody><tr><td>設定物件文件</td><td>/etc/docker/daemon.json</td></tr><tr><td>設定內容</td><td>insecure-registries</td></tr></tbody></table>

</div>設定具體內容。例如以下所看到的：

```
[root@liumiaocn ~]# cat /etc/docker/daemon.json
{
  "insecure-registries": [
    "192.168.32.123:8082",
    "192.168.32.123:8083"
  ],
  "disable-legacy-registry": true
}
[root@liumiaocn ~]#
```

# 重新啟動docker

```
[root@liumiaocn docker]# systemctl restart docker
[root@liumiaocn docker]#
```

# 啟動nexus

隨著docker的重新啟動。 nexus的容器也須要啟動。具體例如以下所看到的：

```
[root@liumiaocn docker]# docker start nexus
nexus
[root@liumiaocn docker]#
```

# 確認

至此，Nexus的設定準備基本就緒。能夠確認結果了。

## docker login

為了進行操作。須事先進行docker login的操作

<div id="bkmrk-%E5%B0%88%E6%A1%88-%E5%85%B7%E9%AB%94%E8%AA%AA%E6%98%8E-private%E5%80%89%E5%BA%AB-do"><table><thead><tr><th>專案</th><th>具體說明</th></tr></thead><tbody><tr><td>private倉庫</td><td>docker login -u admin -p admin123 192.168.32.123:8082</td></tr><tr><td>proxy倉庫</td><td>docker login -u admin -p admin123 192.168.32.123:8083</td></tr></tbody></table>

</div>運行確認

```
[root@liumiaocn ~]# docker login -u admin -p admin123 192.168.32.123:8082
Login Succeeded
[root@liumiaocn ~]# docker login -u admin -p admin123 192.168.32.123:8083
Login Succeeded
[root@liumiaocn ~]#
```

## proxy倉庫確認

從remote倉庫pull下來鏡像。然後確認是否在proxy倉庫中存在

```
[root@liumiaocn ~]# docker pull 192.168.32.123:8083/alpine:3.5
3.5: Pulling from alpine
627beaf3eaaf: Downloading
unknown blob
[root@liumiaocn docker]#
```

查了一下nexus的一些issue，發現有不少都是跟blob相關，看起來相關的小的問題另一些在不斷的收拾中，可是不影響結果。  
確認proxy倉庫，發現pull的alpine的3.5版本號已然在proxy倉庫中保存完成，所以上面的unknown blob也確實沒有影響結果。

[![image-1733280649584.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/e6WzyK7PjFO2KtCE-image-1733280649584.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/e6WzyK7PjFO2KtCE-image-1733280649584.png)

## private倉庫確認

### 事前鏡像確認

```
[root@liumiaocn ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             latest              00f017a8c2a6        2 days ago          1.11 MB
liumiaocn/maven     latest              833b66f10ce6        5 days ago          160 MB
liumiaocn/nexus     latest              932d715eb7e1        5 days ago          460 MB
liumiaocn/gitlab    latest              2462fb291203        5 days ago          1.21 GB
liumiaocn/jenkins   latest              6668ecd39e4f        5 days ago          293 MB
[root@liumiaocn ~]#
```

### tag busybox鏡像

```
[root@liumiaocn ~]# docker tag busybox 192.168.32.123:8082/busybox:latest
[root@liumiaocn ~]# docker images
REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
192.168.32.123:8082/busybox   latest              00f017a8c2a6        2 days ago          1.11 MB
busybox                       latest              00f017a8c2a6        2 days ago          1.11 MB
liumiaocn/maven               latest              833b66f10ce6        5 days ago          160 MB
liumiaocn/nexus               latest              932d715eb7e1        5 days ago          460 MB
liumiaocn/gitlab              latest              2462fb291203        5 days ago          1.21 GB
liumiaocn/jenkins             latest              6668ecd39e4f        5 days ago          293 MB
[root@liumiaocn ~]#
```

### docker push

```
[root@liumiaocn ~]# docker push 192.168.32.123:8082/busybox:latest
The push refers to a repository [192.168.32.123:8082/busybox]
c0de73ac9968: Pushed
latest: digest: sha256:68effe31a4ae8312e47f54bec52d1fc925908009ce7e6f734e1b54a4169081c5 size: 527
[root@liumiaocn ~]#
```

結果確認：busybox鏡像已經被正常地push到了private倉庫中

[![image-1733280612437.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/ro3Zkl6BI0Bgx7sp-image-1733280612437.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/ro3Zkl6BI0Bgx7sp-image-1733280612437.png)

### <span>docker pull</span>

<span>為了確認docker pull的動作。事前先將先前的busybox先刪除，以確認確實下載了新的busybox鏡像到本地。</span>

```
[root@liumiaocn ~]# docker rmi busybox
Untagged: busybox:latest
Untagged: busybox@sha256:32f093055929dbc23dec4d03e09dfe971f5973a9ca5cf059cbfb644c206aa83f
[root@liumiaocn ~]# docker rmi 192.168.32.123:8082/busybox
Untagged: 192.168.32.123:8082/busybox:latest
Untagged: 192.168.32.123:8082/busybox@sha256:68effe31a4ae8312e47f54bec52d1fc925908009ce7e6f734e1b54a4169081c5
Deleted: sha256:00f017a8c2a6e1fe2ffd05c281f27d069d2a99323a8cd514dd35f228ba26d2ff
Deleted: sha256:c0de73ac99683640bc8f8de5cda9e0e2fc97fe53d78c9fd60ea69b31303efbc9
[root@liumiaocn ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
liumiaocn/maven     latest              833b66f10ce6        5 days ago          160 MB
liumiaocn/nexus     latest              932d715eb7e1        5 days ago          460 MB
liumiaocn/gitlab    latest              2462fb291203        5 days ago          1.21 GB
liumiaocn/jenkins   latest              6668ecd39e4f        5 days ago          293 MB
[root@liumiaocn ~]#
```

docker pull操作:能夠看到確實是從private倉庫下載下來了鏡像，並且速度也明顯快了非常之多。

```
[root@liumiaocn ~]# docker pull 192.168.32.123:8082/busybox
Using default tag: latest
latest: Pulling from busybox
04176c8b224a: Pull complete
Digest: sha256:68effe31a4ae8312e47f54bec52d1fc925908009ce7e6f734e1b54a4169081c5
Status: Downloaded newer image for 192.168.32.123:8082/busybox:latest
[root@liumiaocn ~]# docker images
REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
192.168.32.123:8082/busybox   latest              00f017a8c2a6        2 days ago          1.11 MB
liumiaocn/maven               latest              833b66f10ce6        5 days ago          160 MB
liumiaocn/nexus               latest              932d715eb7e1        5 days ago          460 MB
liumiaocn/gitlab              latest              2462fb291203        5 days ago          1.21 GB
liumiaocn/jenkins             latest              6668ecd39e4f        5 days ago          293 MB
[root@liumiaocn ~]#
```

# <span>總結</span>

<span>至此，如何使用Nexus管理Docker映像已然十分清楚，可是怎樣非常好的管理鏡像，備份機制/版本號控制/差分管理/定期cache/及時清理等方面還有非常多問題須要考慮。須要在實際的工作中不斷實踐總結。</span>

# Nexus 常用設定

## Ｍaven 

### my\_maven\_proxy

[https://repo1.maven.org/maven2/](https://repo1.maven.org/maven2/)

[![image-1733281001672.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/L4HFzg8tZyqeDYKj-image-1733281001672.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/L4HFzg8tZyqeDYKj-image-1733281001672.png)

[![image-1733281035906.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/vefWCOpsKvVRodNr-image-1733281035906.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/vefWCOpsKvVRodNr-image-1733281035906.png)

### my\_gradle\_proxy

https://plugins.gradle.org/m2/

[![image-1733449890399.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/k94RVxn4SbRoeVhg-image-1733449890399.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/k94RVxn4SbRoeVhg-image-1733449890399.png)

[![image-1733449910064.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/Uc3Qm93QYNbSrtOt-image-1733449910064.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/Uc3Qm93QYNbSrtOt-image-1733449910064.png)

### my\_maven\_hosted

[![image-1733281074303.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/SjSVinB2wpYCHRVX-image-1733281074303.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/SjSVinB2wpYCHRVX-image-1733281074303.png)

### maven\_google

https://maven.google.com

[![image-1733281325902.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/1Goc7S90kM9tE469-image-1733281325902.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/1Goc7S90kM9tE469-image-1733281325902.png)

[![image-1733281348818.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/AUiscw20pIZOdmWv-image-1733281348818.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/AUiscw20pIZOdmWv-image-1733281348818.png)

### my\_group

[![image-1733281189611.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/AZ6xlwDXau9g9aAk-image-1733281189611.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/AZ6xlwDXau9g9aAk-image-1733281189611.png)

---

### my\_npm\_proxy

[https://registry.npmjs.org/](https://registry.npmjs.org/)

[![image-1733281496213.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/MyPuRfWoaOQxpZwN-image-1733281496213.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/MyPuRfWoaOQxpZwN-image-1733281496213.png)

[![image-1733281973365.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/tb3M5HpMLjbhloXI-image-1733281973365.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/tb3M5HpMLjbhloXI-image-1733281973365.png)

### my\_npm\_hosted

[![image-1733282083806.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/5qgeqq7dvSet3nh9-image-1733282083806.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/5qgeqq7dvSet3nh9-image-1733282083806.png)

### my\_python\_proxy

[https://pypi.python.org/](https://pypi.python.org/)

[![image-1733282279093.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/ur8x94IvuzAErPYO-image-1733282279093.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/ur8x94IvuzAErPYO-image-1733282279093.png)

[![image-1733282309257.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/XGIIbFjl9sBmbGw5-image-1733282309257.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/XGIIbFjl9sBmbGw5-image-1733282309257.png)

### my\_python\_hosts

[![image-1733282349745.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/2HIXIvy9vrR531Kf-image-1733282349745.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/2HIXIvy9vrR531Kf-image-1733282349745.png)

### my\_docker\_proxy

https://registry-1.docker.io

[![image-1733282623249.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/VVBaykEzASyLlJcQ-image-1733282623249.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/VVBaykEzASyLlJcQ-image-1733282623249.png)

[![image-1733282662273.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/MHqaIas3Zj7MWPXx-image-1733282662273.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/MHqaIas3Zj7MWPXx-image-1733282662273.png)

[![image-1733282684529.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/Lenf9IizepLm6odV-image-1733282684529.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/Lenf9IizepLm6odV-image-1733282684529.png)

### my\_docker\_hosted

[![image-1733282739250.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/1Xct4ZgvNIHZlc9N-image-1733282739250.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/1Xct4ZgvNIHZlc9N-image-1733282739250.png)

# Nexus 使用匿名下載(不用登入)

【Security】【Anonymous Access】【Access】打勾

[![image-1733450129929.png](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/scaled-1680-/g6rWZ3w7zUYSh0w4-image-1733450129929.png)](https://bookstack.treemanou.com/uploads/images/gallery/2024-12/g6rWZ3w7zUYSh0w4-image-1733450129929.png)

# Ｎexus  docker-compose.yml

```YAML
version: "3"
services:
  nexus:
    image: sonatype/nexus3
    restart: always
    volumes:
      - "./data/sonatype-work:/sonatype-work"
      - "./data/nexus-data:/nexus-data"
    ports:
      - "8088:8081"
      - "8089:8085"
volumes:
  nexus-data: {}
  
# 取得密碼 /nexus-data/admin.password
# sudo docker exec -it ubuntu_nexus_1 cat /nexus-data/admin.password

```