Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for java 17/21 #1

Closed
yildiz-online opened this issue Jun 7, 2024 · 1 comment
Closed

Build for java 17/21 #1

yildiz-online opened this issue Jun 7, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@yildiz-online
Copy link
Owner

yildiz-online commented Jun 7, 2024

https://help.sonatype.com/en/download.html

Notes: only 17, will not run on 21
Currently only compatible with postgresDB (pro version) due to sonatype/nexus-public#118
OSS version need this to be fixed first.

FROM azul/zulu-openjdk:17 as stage-download

ARG NEXUS_VERSION=3.69.0-02
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-java17-unix.tar.gz

RUN apt update && apt install -y wget
RUN wget --quiet --output-document=/tmp/nexus.tar.gz "${NEXUS_DOWNLOAD_URL}" &&
mkdir /tmp/sonatype &&
tar -zxf /tmp/nexus.tar.gz -C /tmp/sonatype &&
mv /tmp/sonatype/nexus-${NEXUS_VERSION} /tmp/sonatype/nexus &&
rm /tmp/nexus.tar.gz

FROM azul/zulu-openjdk:17 as stage-build

LABEL org.opencontainers.image.base.name="azul/zulu-openjdk:17"
LABEL org.opencontainers.image.revision="-"
LABEL org.opencontainers.image.source="https://github.com/yildiz-online/docker-service-nexus"

COPY --from=downloader /tmp/sonatype /opt/sonatype
RUN
mv /opt/sonatype/sonatype-work/nexus3 /nexus-data &&
ln -s /nexus-data /opt/sonatype/sonatype-work/nexus3

RUN sed -i '/^-Xms/d;/^-Xmx/d;/^-XX:MaxDirectMemorySize/d' /opt/sonatype/nexus/bin/nexus.vmoptions

RUN sed -i -e 's/^nexus-context-path=//nexus-context-path=/${NEXUS_CONTEXT}/g' /opt/sonatype/nexus/etc/nexus-default.properties

RUN groupadd --gid 200 nexus &&
useradd
--system
--shell /bin/false
--comment 'Nexus Repository Manager user'
--home-dir /opt/sonatype/nexus
--no-create-home
--no-user-group
--uid 200
--gid 200
nexus

RUN chown -R nexus:nexus /nexus-data

VOLUME /nexus-data

EXPOSE 8081

USER nexus

ENV NEXUS_HOME=/opt/sonatype/nexus
NEXUS_DATA=/nexus-data
NEXUS_CONTEXT=''
SONATYPE_WORK=/opt/sonatype/sonatype-work
INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=/nexus-data/javaprefs"

CMD ["/opt/sonatype/nexus/bin/nexus", "run"]

@yildiz-online yildiz-online added the enhancement New feature or request label Jun 7, 2024
@yildiz-online yildiz-online self-assigned this Jun 7, 2024
@yildiz-online
Copy link
Owner Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant