mirror of
https://github.com/pischule/memevizor.git
synced 2026-02-04 00:50:52 +00:00
Hardcode uid, gid in Dockerfile
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
FROM docker.io/eclipse-temurin:21
|
||||
|
||||
ARG USER_ID=10001
|
||||
ARG GROUP_ID=10001
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y ffmpeg \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN groupadd --system app \
|
||||
&& useradd --no-log-init --system --shell /sbin/nologin --gid app app
|
||||
RUN groupadd -g ${GROUP_ID} app \
|
||||
&& useradd --no-log-init -u ${USER_ID} -g app --shell /sbin/nologin app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -14,7 +17,7 @@ ARG JAR_FILE=build/libs/*.jar
|
||||
COPY --chown=app:app ${JAR_FILE} app.jar
|
||||
COPY --chown=app:app build/resources/main/static BOOT-INF/classes/static
|
||||
|
||||
USER app:app
|
||||
USER ${USER_ID}:${GROUP_ID}
|
||||
|
||||
ENTRYPOINT ["java","-jar","app.jar"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user