使用docker images sonatype/nexus3來快速建立環境,nexus3是opensource,可自行編譯使用。不過有部份外掛套件是需要付費使用的,像是Azure Blob Storage,此時可以選擇付費使用Nexus3 pro版本。
建立docker-compose.yml (記得建立一個nexus-data目錄來存放blob資料)
version: "3.5"
services:
mariadb:
container_name: nexus3
image: sonatype/nexus3
environment:
TZ: Asia/Taipei
ports:
- "127.0.0.1:8081:8081"
volumes:
- ./nexus-data:/nexus-data
restart: unless-stopped
logging:
options:
max-size: 512M
# deploy:
# resources:
# limits:
#cpus: '0.50'
# memory: 1024M
啟動docker
sudo docker-compose up -d
設定virtualhost來對應Nexus3服務
<VirtualHost *:80>
ServerName nexus3.yourdomain
ProxyRequests off
ProxyPreserveHost On
ProxyPass "/" "http://127.0.0.1:8081/"
ProxyPassReverse "/" "http://127.0.0.1:8081/"
</VirtualHost>
取得admin預設密碼,來登入設定
nano nexus-data/admin.password
新增repository
選擇新增一個maven host及docker host
Read More