forked from drtshock/Potato
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.spud
More file actions
27 lines (19 loc) · 716 Bytes
/
Dockerfile.spud
File metadata and controls
27 lines (19 loc) · 716 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
########### Phase 1 - Compile ###########
FROM maven:3.9.8-eclipse-temurin-8-alpine AS potato-builder
# Set the working directory and copy src
WORKDIR /usr/src/Potato
COPY . /usr/src/Potato/
# Build with Maven
RUN mvn clean install;
########### Phase 2 - Package ###########
FROM eclipse-temurin:21
# Can be overridden with `docker run -e VEGAN="--vegan"`
ENV VEGAN=""
# Make am appropriate user name
RUN useradd -u 500 mrpotatohead
USER mrpotatohead
WORKDIR /home/mrpotatohead
# Cook this potato right every time
COPY --from=potato-builder /usr/src/Potato/target /home/mrpotatohead/target
# Allow user to pass in an argument when running the container
CMD ["sh","-c","java -jar target/Potato.jar ${VEGAN}"]