Skip to content

Commit 6a65f3c

Browse files
authored
Merge pull request #19 from klo2k/upgrade_3.43.0
Upgrade 3.43.0
2 parents 0eefa2b + 8cc4ca7 commit 6a65f3c

File tree

3 files changed

+42
-26
lines changed

3 files changed

+42
-26
lines changed

Dockerfile

+13-22
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
# Download, extract Nexus to /tmp/sonatype/nexus
22
FROM eclipse-temurin:8-jre-jammy as downloader
33

4-
ARG NEXUS_VERSION=3.40.1-01
4+
ARG NEXUS_VERSION=3.43.0-01
55
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
66

77
# Download Nexus and other stuff we need later
88
# Use wget to improve performance (#11)
99
# Install wget
1010
RUN apt update && apt install -y wget
11-
# Download jars required for OrientDB startup error hack
12-
RUN wget --quiet --directory-prefix=/tmp/ \
13-
https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.5.0/jna-5.5.0.jar \
14-
https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.5.0/jna-platform-5.5.0.jar
1511
# Download + extract Nexus to "/tmp/sonatype/nexus" for use later
1612
RUN wget --quiet --output-document=/tmp/nexus.tar.gz "${NEXUS_DOWNLOAD_URL}" && \
1713
mkdir /tmp/sonatype && \
@@ -41,29 +37,18 @@ RUN \
4137
# Work directory (/opt/sonatype/sonatype-work/nexus3)
4238
ln -s /nexus-data /opt/sonatype/sonatype-work/nexus3
4339

44-
# Setup: Start-up script (from official image)
45-
COPY files/opt/sonatype/start-nexus-repository-manager.sh /opt/sonatype/start-nexus-repository-manager.sh
46-
RUN chmod 755 /opt/sonatype/start-nexus-repository-manager.sh
47-
4840
# Fix-up: Startup command line: Remove hard-coded memory parameters in /opt/sonatype/nexus/bin/nexus.vmoptions (per official Docker image)
49-
RUN sed -i -e '/^-Xms\|^-Xmx\|^-XX:MaxDirectMemorySize/d' /opt/sonatype/nexus/bin/nexus.vmoptions
41+
RUN sed -i '/^-Xms/d;/^-Xmx/d;/^-XX:MaxDirectMemorySize/d' /opt/sonatype/nexus/bin/nexus.vmoptions
5042

5143
# Enable NEXUS_CONTEXT env-variable via nexus-default.properties
5244
RUN sed -i -e 's/^nexus-context-path=\//nexus-context-path=\/\${NEXUS_CONTEXT}/g' /opt/sonatype/nexus/etc/nexus-default.properties
5345

54-
# Fix-up: Startup error with OrientDB on ARM - replace in-place 5.4.0 with 5.5.0 lib (reference is hard-coded in config files)
55-
# http://bhamail.github.io/pinexus/nexussetup.html
56-
COPY --from=downloader /tmp/jna-5.5.0.jar /opt/sonatype/nexus/system/net/java/dev/jna/jna/5.4.0/jna-5.4.0.jar
57-
COPY --from=downloader /tmp/jna-platform-5.5.0.jar /opt/sonatype/nexus/system/net/java/dev/jna/jna-platform/5.4.0/jna-platform-5.4.0.jar
58-
RUN chmod 644 \
59-
/opt/sonatype/nexus/system/net/java/dev/jna/jna/5.4.0/jna-5.4.0.jar \
60-
/opt/sonatype/nexus/system/net/java/dev/jna/jna-platform/5.4.0/jna-platform-5.4.0.jar
61-
6246
# Create Nexus user + group, based on official image:
6347
# nexus:x:200:200:Nexus Repository Manager user:/opt/sonatype/nexus:/bin/false
6448
# nexus:x:200:nexus
6549
RUN groupadd --gid 200 nexus && \
6650
useradd \
51+
--system \
6752
--shell /bin/false \
6853
--comment 'Nexus Repository Manager user' \
6954
--home-dir /opt/sonatype/nexus \
@@ -73,16 +58,22 @@ RUN groupadd --gid 200 nexus && \
7358
--gid 200 \
7459
nexus
7560

76-
# Data directory "/nexus-data" owns "nexus" user
61+
# Data directory "/nexus-data" owned by "nexus" user
7762
RUN chown -R nexus:nexus /nexus-data
7863

64+
# Data volume
7965
VOLUME /nexus-data
8066

8167
EXPOSE 8081
8268

8369
USER nexus
8470

85-
ENV INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=/nexus-data/javaprefs"
86-
ENV NEXUS_CONTEXT=''
71+
# Default environment variables, adapted from upstream Dockerfile
72+
ENV NEXUS_HOME=/opt/sonatype/nexus \
73+
NEXUS_DATA=/nexus-data \
74+
NEXUS_CONTEXT='' \
75+
SONATYPE_WORK=/opt/sonatype/sonatype-work \
76+
# Low `-Xms`, `-Xmx` default for Raspberry Pi
77+
INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=/nexus-data/javaprefs"
8778

88-
CMD ["sh", "-c", "/opt/sonatype/start-nexus-repository-manager.sh"]
79+
CMD ["/opt/sonatype/nexus/bin/nexus", "run"]

docker-compose.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Example docker-compose file to build + run locally:
2+
# docker-compose build
3+
# docker-compose up
4+
services:
5+
nexus:
6+
build:
7+
context: .
8+
# Build for arm64, uncomment to build for armv7
9+
platforms:
10+
- linux/arm64
11+
#- linux/arm/v7
12+
image: klo2k/nexus3:latest
13+
container_name: nexus
14+
# environment:
15+
# # Run this under http://localhost:8081/nxrm/
16+
# NEXUS_CONTEXT: 'nxrm'
17+
volumes:
18+
- nexus-data:/nexus-data
19+
ports:
20+
- 127.0.0.1:8081:8081
21+
networks:
22+
- nexus
23+
24+
networks:
25+
nexus:
26+
driver: bridge
27+
28+
volumes:
29+
nexus-data:

files/opt/sonatype/start-nexus-repository-manager.sh

-4
This file was deleted.

0 commit comments

Comments
 (0)