Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 260286e

Browse files
authored
Merge pull request #19 from mpoindexter/Hermain-master
Add docker support based on PR from Hermain
2 parents b7a6fcd + a7709fc commit 260286e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ARG NEXUS_VERSION=3.6.0
2+
3+
FROM maven:3-jdk-8-alpine AS build
4+
ARG NEXUS_VERSION=3.6.0
5+
ARG NEXUS_BUILD=02
6+
7+
COPY . /nexus-repository-apt/
8+
RUN cd /nexus-repository-apt/; sed -i "s/3.5.0-02/${NEXUS_VERSION}-${NEXUS_BUILD}/g" pom.xml; \
9+
mvn;
10+
11+
FROM sonatype/nexus3:$NEXUS_VERSION
12+
ARG NEXUS_VERSION=3.6.0
13+
ARG NEXUS_BUILD=02
14+
USER root
15+
RUN mkdir /opt/sonatype/nexus/system/net/staticsnow/ /opt/sonatype/nexus/system/net/staticsnow/nexus-repository-apt/ /opt/sonatype/nexus/system/net/staticsnow/nexus-repository-apt/1.0.2/; \
16+
sed -i 's@nexus-repository-npm</feature>@nexus-repository-npm</feature>\n <feature prerequisite="false" dependency="false">nexus-repository-apt</feature>@g' /opt/sonatype/nexus/system/com/sonatype/nexus/assemblies/nexus-oss-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-oss-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml; \
17+
sed -i 's@<feature name="nexus-repository-npm"@<feature name="nexus-repository-apt" description="net.staticsnow:nexus-repository-apt" version="1.0.2">\n <details>net.staticsnow:nexus-repository-apt</details>\n <bundle>mvn:net.staticsnow/nexus-repository-apt/1.0.2</bundle>\n </feature>\n <feature name="nexus-repository-npm"@g' /opt/sonatype/nexus/system/com/sonatype/nexus/assemblies/nexus-oss-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-oss-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml;
18+
COPY --from=build /nexus-repository-apt/target/nexus-repository-apt-1.0.2.jar /opt/sonatype/nexus/system/net/staticsnow/nexus-repository-apt/1.0.2/
19+
USER nexus

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
cd nexus-repository
1111
mvn
1212
```
13+
### Build with docker and create an image based on nexus repository 3
14+
15+
``` docker build -t nexus-repository-apt:3.6.0 .```
16+
17+
### Run a docker container from that image
18+
19+
``` docker run -d -p 8081:8081 --name nexus-repository-apt:3.6.0 ```
20+
21+
For further information like how to persist volumes view https://github.com/sonatype/docker-nexus3
22+
The application is now available from the browser on localhost:8081
1323

1424
### Install
1525
* Stop Nexus:

0 commit comments

Comments
 (0)