Skip to content

Commit

Permalink
Merge branch 'upgrade-to-temurin'
Browse files Browse the repository at this point in the history
Closes #17
  • Loading branch information
klo2k committed Jul 2, 2022
2 parents 51d4314 + 43853e1 commit 0eefa2b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
21 changes: 3 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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_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
Expand All @@ -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://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add - && \
add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ && \
# 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 && \
# 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
Expand Down
25 changes: 14 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
Expand All @@ -46,7 +47,8 @@ docker buildx build --pull \
```

Build ARM 64-bit (aarch64):
```

```bash
docker buildx build --pull \
--platform "linux/arm64" \
--tag "klo2k/nexus3" \
Expand All @@ -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)

0 comments on commit 0eefa2b

Please sign in to comment.