-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 977 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# syntax=docker/dockerfile:1
# ── dev: Ubuntu 24.04 development environment ───────────────────
FROM ubuntu:24.04 AS dev
RUN apt-get update && \
apt-get install -y --no-install-recommends \
openjdk-17-jdk-headless maven git && \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY . .
RUN --mount=type=cache,target=/root/.m2/repository \
mvn dependency:go-offline -q
CMD ["bash"]
# ── build: compile, test, package ────────────────────────────────
FROM dev AS build
ARG MAVEN_GOALS="clean verify"
ARG MAVEN_OPTS=""
RUN --mount=type=cache,target=/root/.m2/repository \
mvn ${MAVEN_GOALS} ${MAVEN_OPTS} -B
# ── package: .hpi artifact only ──────────────────────────────────
FROM ubuntu:24.04 AS package
COPY --from=build /workspace/target/*.hpi /opt/sentinel.hpi