From a4e8824409113af14a85ea240ff85777ce7a5f5b Mon Sep 17 00:00:00 2001 From: Dinesh Auti Date: Thu, 16 Jun 2022 19:54:28 -0400 Subject: [PATCH 1/4] upgrade to temurin --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd5ca29..3e0680c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,12 +37,12 @@ ARG DEBIAN_FRONTEND=noninteractive RUN apt update && \ # Add AdoptOpenJDK repo apt install --yes apt-transport-https ca-certificates gnupg software-properties-common wget && \ - wget --quiet --output-document=- https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add - && \ - add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ && \ + wget --quiet --output-document=- https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - && \ + echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list && \ # Work-around adoptopenjdk-8-hotspot-jre installation error mkdir --parent /usr/share/man/man1/ && \ # Install JRE 8 along with missing dependency - apt update && apt install --yes adoptopenjdk-8-hotspot-jre libatomic1 && \ + apt update && apt install --yes temurin-8-jdk libatomic1 && \ # Clean-up apt purge --yes apt-transport-https gnupg software-properties-common wget && \ apt autoremove --yes && apt clean @@ -100,4 +100,4 @@ USER nexus ENV INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=/nexus-data/javaprefs" ENV NEXUS_CONTEXT='' -CMD ["sh", "-c", "/opt/sonatype/start-nexus-repository-manager.sh"] +CMD ["sh", "-c", "/opt/sonatype/start-nexus-repository-manager.sh"] \ No newline at end of file From 5f52b232792f41116015943190d05a1f9497461e Mon Sep 17 00:00:00 2001 From: Kok-Yan Lo Date: Sat, 2 Jul 2022 00:41:19 +1000 Subject: [PATCH 2/4] Use Temurin JRE 8 image as base To keep Dockerfile simple, we now use Eclipse Temurin JRE 8 image as base. Thanks for dinesh-auti (a4e88244) for prompting me to to this :-) --- Dockerfile | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e0680c..ba26030 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Download, extract Nexus to /tmp/sonatype/nexus -FROM debian:buster-slim as downloader +FROM eclipse-temurin:8-jre-jammy as downloader ARG NEXUS_VERSION=3.38.1-01 ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz @@ -25,28 +25,13 @@ RUN wget --quiet --output-document=/tmp/nexus.tar.gz "${NEXUS_DOWNLOAD_URL}" && # Runtime image # Logic adapted from official Dockerfile # https://github.com/sonatype/docker-nexus3/blob/master/Dockerfile -FROM debian:buster-slim +FROM eclipse-temurin:8-jre-jammy # Image metadata # git commit LABEL org.opencontainers.image.revision="-" LABEL org.opencontainers.image.source="https://github.com/klo2k/nexus3-docker" -# Install Java 8 -ARG DEBIAN_FRONTEND=noninteractive -RUN apt update && \ - # Add AdoptOpenJDK repo - apt install --yes apt-transport-https ca-certificates gnupg software-properties-common wget && \ - wget --quiet --output-document=- https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - && \ - echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list && \ - # Work-around adoptopenjdk-8-hotspot-jre installation error - mkdir --parent /usr/share/man/man1/ && \ - # Install JRE 8 along with missing dependency - apt update && apt install --yes temurin-8-jdk libatomic1 && \ - # Clean-up - apt purge --yes apt-transport-https gnupg software-properties-common wget && \ - apt autoremove --yes && apt clean - # Setup: Rename App, Data and Work directory per official image # App directory (/opt/sonatype/nexus) COPY --from=downloader /tmp/sonatype /opt/sonatype @@ -100,4 +85,4 @@ USER nexus ENV INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=/nexus-data/javaprefs" ENV NEXUS_CONTEXT='' -CMD ["sh", "-c", "/opt/sonatype/start-nexus-repository-manager.sh"] \ No newline at end of file +CMD ["sh", "-c", "/opt/sonatype/start-nexus-repository-manager.sh"] From 3ecdd2f6df8f17664fe740d6f87300447ec0a2cd Mon Sep 17 00:00:00 2001 From: Kok-Yan Lo Date: Sat, 2 Jul 2022 17:04:49 +1000 Subject: [PATCH 3/4] Readme: Update buildx procedures and fix markdown lint --- Readme.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Readme.md b/Readme.md index b717d29..50533be 100644 --- a/Readme.md +++ b/Readme.md @@ -11,22 +11,22 @@ So I'm creating one and sharing it with everyone :-) . -# Running -``` +## Running + +```bash docker run -d -p 8081:8081 --name nexus klo2k/nexus3 ``` -# Building with "docker buildx" locally -Initialise [buildx](https://docs.docker.com/buildx/working-with-buildx/), if you're on a x64 machine: -``` -# Enable experimental mode -export DOCKER_CLI_EXPERIMENTAL=enabled +## Building with "docker buildx" locally +Initialise [buildx](https://docs.docker.com/desktop/multi-arch/), if you're on a x64 machine: + +```bash # Enable ARM support -docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 +docker run --rm --privileged multiarch/qemu-user-static --reset --persistent yes # Create 'mybuilder' if not exist, set as default builder docker buildx inspect mybuilder||docker buildx create --name mybuilder @@ -37,7 +37,8 @@ docker buildx inspect --bootstrap ``` Build ARM 32-bit (armv7l): -``` + +```bash docker buildx build --pull \ --platform "linux/arm/v7" \ --tag "klo2k/nexus3" \ @@ -46,7 +47,8 @@ docker buildx build --pull \ ``` Build ARM 64-bit (aarch64): -``` + +```bash docker buildx build --pull \ --platform "linux/arm64" \ --tag "klo2k/nexus3" \ @@ -57,7 +59,8 @@ docker buildx build --pull \ -# Credits +## Credits + - *Nexus Team*: For the awesome repo, and their [Dockerfile](https://github.com/sonatype/docker-nexus3/blob/master/Dockerfile) - *Dan Rollo (bhamail)*: For the [jna-platform jar hack](https://bhamail.github.io/pinexus/nexussetup.html) - *Henry Wang (HenryQW)*: For [Docker buildx Github Action](https://www.henry.wang/2019/12/05/arm-dockerhub.html) From 43853e105b7117c183068c63e0dbe2ccca01c604 Mon Sep 17 00:00:00 2001 From: Kok-Yan Lo Date: Sat, 2 Jul 2022 02:23:35 +1000 Subject: [PATCH 4/4] Upgrade to 3.40.1-01 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ba26030..6e726f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Download, extract Nexus to /tmp/sonatype/nexus FROM eclipse-temurin:8-jre-jammy as downloader -ARG NEXUS_VERSION=3.38.1-01 +ARG NEXUS_VERSION=3.40.1-01 ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz # Download Nexus and other stuff we need later