docker鏡像:sonatype/docker-nexus

Docker images for Sonatype Nexus Repository Manager 2 with the Oracle JDK. For Nexus Repository Manager 3, please refer to https://github.com/sonatype/docker-nexus3

To build:

# docker build --rm --tag sonatype/nexus oss/
# docker build --rm --tag sonatype/nexus:pro pro/

To run (if port 8081 is open on your host):

# docker run -d -p 8081:8081 --name nexus sonatype/nexus:oss

To determine the port that the container is listening on:

# docker ps -l

To test:

$ curl http://localhost:8081/nexus/service/local/status

To build, copy the Dockerfile and do the build:

$ docker build --rm=true --tag=sonatype/nexus .

Notes

  • Default credentials are: admin / admin123

  • It can take some time (2-3 minutes) for the service to launch in a new container. You can tail the log to determine once Nexus is ready:

$ docker logs -f nexus

  • Installation of Nexus is to /opt/sonatype/nexus. Notably: /opt/sonatype/nexus/conf/nexus.properties is the properties file. Parameters (nexus-work and nexus-webapp-context-path) defined here are overridden in the JVM invocation.

  • A persistent directory, /sonatype-work, is used for configuration, logs, and storage. This directory needs to be writeable by the Nexus process, which runs as UID 200.

  • Environment variables can be used to control the JVM arguments

    • CONTEXT_PATH, passed as -Dnexus-webapp-context-path. This is used to define the URL which Nexus is accessed. Defaults to '/nexus'
    • MAX_HEAP, passed as -Xmx. Defaults to 768m.
    • MIN_HEAP, passed as -Xms. Defaults to 256m.
    • JAVA_OPTS. Additional options can be passed to the JVM via this variable. Default: -server -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true.
    • LAUNCHER_CONF. A list of configuration files supplied to the Nexus bootstrap launcher. Default: ./conf/jetty.xml ./conf/jetty-requestlog.xml

    These can be user supplied at runtime to control the JVM:

    $ docker run -d -p 8081:8081 --name nexus -e MAX_HEAP=768m sonatype/nexus
    
    

Persistent Data

There are two general approaches to handling persistent storage requirements with Docker. See Managing Data in Containers for additional information.

  1. Use a data volume container. Since data volumes are persistent until no containers use them, a container can be created specifically for this purpose. This is the recommended approach.

    $ docker run -d --name nexus-data sonatype/nexus echo "data-only container for Nexus"
    $ docker run -d -p 8081:8081 --name nexus --volumes-from nexus-data sonatype/nexus
    
    
  2. Mount a host directory as the volume. This is not portable, as it relies on the directory existing with correct permissions on the host. However it can be useful in certain situations where this volume needs to be assigned to certain underlying storage.

    $ mkdir /some/dir/nexus-data && chown -R 200 /some/dir/nexus-data
    $ docker run -d -p 8081:8081 --name nexus -v /some/dir/nexus-data:/sonatype-work sonatype/nexus
    
    

Adding Nexus Plugins

Creating a docker image based on sonatype/nexus is the suggested process: plugins should be expanded to /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository. See https://github.com/sonatype/docker-nexus/issues/9 for an example concerning the Nexus P2 plugins.

Getting Help

Looking to contribute to our Docker image but need some help? There's a few ways to get information or our attention:

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市浪耘,隨后出現(xiàn)的幾起案子俊犯,更是在濱河造成了極大的恐慌份汗,老刑警劉巖范抓,帶你破解...
    沈念sama閱讀 222,627評(píng)論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件岔乔,死亡現(xiàn)場離奇詭異肉瓦,居然都是意外死亡永品,警方通過查閱死者的電腦和手機(jī)做鹰,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,180評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來鼎姐,“玉大人钾麸,你說我怎么就攤上這事】唤埃” “怎么了饭尝?”我有些...
    開封第一講書人閱讀 169,346評(píng)論 0 362
  • 文/不壞的土叔 我叫張陵,是天一觀的道長谋作。 經(jīng)常有香客問我,道長乎芳,這世上最難降的妖魔是什么遵蚜? 我笑而不...
    開封第一講書人閱讀 60,097評(píng)論 1 300
  • 正文 為了忘掉前任,我火速辦了婚禮奈惑,結(jié)果婚禮上吭净,老公的妹妹穿的比我還像新娘。我一直安慰自己肴甸,他們只是感情好寂殉,可當(dāng)我...
    茶點(diǎn)故事閱讀 69,100評(píng)論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著原在,像睡著了一般友扰。 火紅的嫁衣襯著肌膚如雪彤叉。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,696評(píng)論 1 312
  • 那天村怪,我揣著相機(jī)與錄音秽浇,去河邊找鬼。 笑死甚负,一個(gè)胖子當(dāng)著我的面吹牛柬焕,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播梭域,決...
    沈念sama閱讀 41,165評(píng)論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼斑举,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了病涨?” 一聲冷哼從身側(cè)響起富玷,我...
    開封第一講書人閱讀 40,108評(píng)論 0 277
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎没宾,沒想到半個(gè)月后凌彬,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,646評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡循衰,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,709評(píng)論 3 342
  • 正文 我和宋清朗相戀三年铲敛,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片会钝。...
    茶點(diǎn)故事閱讀 40,861評(píng)論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡伐蒋,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出迁酸,到底是詐尸還是另有隱情先鱼,我是刑警寧澤,帶...
    沈念sama閱讀 36,527評(píng)論 5 351
  • 正文 年R本政府宣布奸鬓,位于F島的核電站焙畔,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏串远。R本人自食惡果不足惜宏多,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,196評(píng)論 3 336
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望澡罚。 院中可真熱鬧伸但,春花似錦、人聲如沸留搔。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,698評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至却妨,卻和暖如春饵逐,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背管呵。 一陣腳步聲響...
    開封第一講書人閱讀 33,804評(píng)論 1 274
  • 我被黑心中介騙來泰國打工梳毙, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人捐下。 一個(gè)月前我還...
    沈念sama閱讀 49,287評(píng)論 3 379
  • 正文 我出身青樓账锹,卻偏偏與公主長得像,于是被迫代替她去往敵國和親坷襟。 傳聞我的和親對(duì)象是個(gè)殘疾皇子奸柬,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,860評(píng)論 2 361

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