forked from sonatype-nexus-community/nexus-repository-cargo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
19 lines (15 loc) · 825 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# declaration of NEXUS_VERSION must appear before first FROM command
# see: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG NEXUS_VERSION=latest
FROM maven:3-jdk-8-alpine AS build
COPY . /nexus-repository-cargo/
# requires BUILDKIT, caches .m2 between builds. Use --no-cache to build from scratch
RUN --mount=type=cache,target=/root/.m2 cd /nexus-repository-cargo/; \
mvn clean package -PbuildKar;
FROM sonatype/nexus3:$NEXUS_VERSION
ARG DEPLOY_DIR=/opt/sonatype/nexus/deploy/
USER root
COPY --from=build /nexus-repository-cargo/target/nexus-repository-cargo-*-bundle.kar ${DEPLOY_DIR}
# Uncomment the next line to enable nexus console. Useful for debugging.
# RUN sed -e 's/\(-Dkaraf.startLocalConsole=\)false/\1true/g' /opt/sonatype/nexus/bin/nexus.vmoptions
USER nexus