あるフリーランスエンジニアの色んなメモ!! ITスキル・ライフハックとか

docker-composeでNexusをインストールする

コンテナの概要

Docker Hub

https://hub.docker.com/r/sonatype/nexus3/

User

uid=200(nexus) gid=200(nexus) groups=200(nexus),0(root)

Port

  • 8081:http Web IF

Volume

  • /nexus-data:設定ファイル・log・storage
    ※「/opt/sonatype/sonatype-work/nexus3」のsymlink
  • /opt/sonatype/nexus:jettyの設定等

仕様メモ

  • 初期設定されている管理者アカウント
    Username:admin
    Password:admin123
  • defaultのendpoint
    http://nexus:8081/

docker-compose設定例

version: '3'

volumes:
  nexus-data:

services:
  nexus:
    image: sonatype/nexus3
    ports:
      - 8081:8081
    volumes:
      - nexus-data:/nexus-data

JVMオプションを設定する

環境変数に「INSTALL4J_ADD_VM_PARAMS」を設定

...

services:
  nexus:
    image: sonatype/nexus3
    environment:
      INSTALL4J_ADD_VM_PARAMS: "-Xms1200m -Xmx1200m"
      ...

コンテキストルートを変更する

環境変数に「NEXUS_CONTEXT」を設定

http://nexus:8081/nexus/ を設定する場合

...

services:
  nexus:
    image: sonatype/nexus3
    environment:
      NEXUS_CONTEXT: nexus
      ...
comments powered by Disqus