Run twigs as user instead of root in docker image
This commit is contained in:
parent
6b606b86a9
commit
b6ccae2abe
1 changed files with 4 additions and 1 deletions
|
@ -10,5 +10,8 @@ RUN /home/gradle/src/gradlew --console=plain --no-daemon shadowJar
|
|||
|
||||
FROM adoptopenjdk:openj9
|
||||
EXPOSE 8080
|
||||
COPY --from=builder /home/gradle/src/app/build/libs/twigs.jar twigs.jar
|
||||
RUN groupadd --system --gid 1000 twigs \
|
||||
&& useradd --system --gid twigs --uid 1000 --create-home twigs
|
||||
COPY --from=builder --chown=twigs:twigs /home/gradle/src/app/build/libs/twigs.jar twigs.jar
|
||||
USER twigs
|
||||
CMD /opt/java/openjdk/bin/java $JVM_ARGS -jar /twigs.jar
|
||||
|
|
Loading…
Reference in a new issue