-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from PBH-BTN/docker
Use 2-stage Dockerfile to ensure image reproducible
- Loading branch information
Showing
2 changed files
with
13 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
FROM eclipse-temurin:17.0.10_7-jre | ||
FROM maven:3.9.6-eclipse-temurin-22 as build | ||
|
||
LABEL MAINTAINER="https://github.com/PBH-BTN/PeerBanHelper" | ||
|
||
ENV TZ=UTC PUID=0 PGID=0 | ||
|
||
RUN set -ex && \ | ||
export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get update -y && \ | ||
apt-get install -y gosu dumb-init && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
ADD . /build | ||
WORKDIR /build | ||
RUN sh setup-webui.sh && mvn -B clean package --file pom.xml | ||
|
||
FROM ubuntu/jre:17_edge | ||
LABEL MAINTAINER="https://github.com/PBH-BTN/PeerBanHelper" | ||
USER 0 | ||
ENV TZ=UTC | ||
WORKDIR /app | ||
|
||
COPY --chmod=755 ./docker-entrypoint.sh /app/ | ||
|
||
COPY ./target/PeerBanHelper.jar /app/ | ||
|
||
ENTRYPOINT [ "/app/docker-entrypoint.sh" ] | ||
VOLUME /tmp | ||
COPY --from=build build/target/PeerBanHelper.jar /app/PeerBanHelper.jar | ||
ENV PATH "${JAVA_HOME}/bin:${PATH}" | ||
ENTRYPOINT ["java","-Xmx256M","-XX:+UseSerialGC","-jar","PeerBanHelper.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters