1
- # Using the docker-nexus3 Dockerfile, removing VOLUME to run on OpenShift
2
- # Until we have initContainers in Kubernetes 1.4 we have to use a custom script to configure nexus after starting
3
- FROM fabric8/java-centos-openjdk8-jre
1
+ # https://github.com/sonatype/ docker-nexus3
2
+ # https://hub.docker.com/r/sonatype/nexus3
3
+ FROM sonatype/nexus3:3.28.1
4
4
5
- ENV NEXUS_DATA /nexus-data
5
+ ENV NEXUS_PLUGINS ${NEXUS_HOME}/system
6
6
7
- ENV NEXUS_VERSION 3.0.2-02
7
+ # https://github.com/flytreeleft/nexus3-keycloak-plugin
8
+ ENV KEYCLOAK_PLUGIN_VERSION 0.4.1-SNAPSHOT
9
+ # The release name in the release page: https://github.com/flytreeleft/nexus3-keycloak-plugin/releases
10
+ ENV KEYCLOAK_PLUGIN_RELEASE_NAME 0.4.1-prev1-SNAPSHOT
11
+ ENV KEYCLOAK_PLUGIN /org/github/flytreeleft/nexus3-keycloak-plugin/${KEYCLOAK_PLUGIN_VERSION}/nexus3-keycloak-plugin-${KEYCLOAK_PLUGIN_VERSION}
8
12
9
- RUN yum install -y \
10
- curl tar \
11
- && yum clean all
13
+ USER root
12
14
13
- # install nexus
14
- RUN mkdir -p /opt/sonatype/nexus \
15
- && curl --fail --silent --location --retry 3 \
16
- https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz \
17
- | gunzip \
18
- | tar x -C /opt/sonatype/nexus --strip-components=1 nexus-${NEXUS_VERSION} \
19
- && chown -R root:root /opt/sonatype/nexus
15
+ ADD https://github.com/flytreeleft/nexus3-keycloak-plugin/releases/download/${KEYCLOAK_PLUGIN_RELEASE_NAME}/nexus3-keycloak-plugin-${KEYCLOAK_PLUGIN_VERSION}.jar \
16
+ ${NEXUS_PLUGINS}${KEYCLOAK_PLUGIN}.jar
20
17
21
- # # configure nexus runtime env
22
- RUN sed \
23
- -e "s|karaf.home=.|karaf.home=/opt/sonatype/nexus|g" \
24
- -e "s|karaf.base=.|karaf.base=/opt/sonatype/nexus|g" \
25
- -e "s|karaf.etc=etc|karaf.etc=/opt/sonatype/nexus/etc|g" \
26
- -e "s|java.util.logging.config.file=etc|java.util.logging.config.file=/opt/sonatype/nexus/etc|g" \
27
- -e "s|karaf.data=data|karaf.data=${NEXUS_DATA}|g" \
28
- -e "s|java.io.tmpdir=data/tmp|java.io.tmpdir=${NEXUS_DATA}/tmp|g" \
29
- -i /opt/sonatype/nexus/bin/nexus.vmoptions
18
+ RUN chmod 644 ${NEXUS_PLUGINS}${KEYCLOAK_PLUGIN}.jar
19
+ RUN echo "reference\: file\: ${KEYCLOAK_PLUGIN}.jar = 200" >> ${NEXUS_HOME}/etc/karaf/startup.properties
30
20
31
- RUN useradd -r -u 200 -m -c "nexus role account" -d ${NEXUS_DATA} -s /bin/false nexus
32
-
33
- ENV EXTRA_JAVA_OPTS ""
34
-
35
- EXPOSE 8081
36
-
37
- ADD *.json /opt/sonatype/nexus/
38
- ADD postStart.sh /opt/sonatype/nexus/
39
-
40
- RUN chown nexus:nexus /opt/sonatype/nexus/
21
+ # setup permissions
22
+ RUN chown nexus:nexus -R /opt/sonatype/nexus
41
23
42
24
USER nexus
43
- WORKDIR /opt/sonatype/nexus
44
-
45
- CMD bin/nexus run
0 commit comments