Skip to content

Commit

Permalink
#5950 Pulling up user creation in Dockerfile for layer caching;
Browse files Browse the repository at this point in the history
In case of rebuilding an image, the create user command would run again before, as it came after the more volatile commands for adding dependencies and runner.
  • Loading branch information
gunnarmorling committed Dec 7, 2019
1 parent de21598 commit 20ab68e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
FROM fabric8/java-alpine-openjdk8-jre:1.6.5
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV AB_ENABLED=jmx_exporter
COPY ${build_dir}/lib/* /deployments/lib/
COPY ${build_dir}/*-runner.jar /deployments/app.jar
EXPOSE 8080

# run with user 1001 and be prepared for be running in OpenShift too
# Be prepared for running in OpenShift too
RUN adduser -G root --no-create-home --disabled-password 1001 \
&& chown -R 1001 /deployments \
&& chmod -R "g+rwX" /deployments \
&& chown -R 1001:root /deployments

COPY ${build_dir}/lib/* /deployments/lib/
COPY ${build_dir}/*-runner.jar /deployments/app.jar
EXPOSE 8080

# run with user 1001
USER 1001

ENTRYPOINT [ "/deployments/run-java.sh" ]
ENTRYPOINT [ "/deployments/run-java.sh" ]

0 comments on commit 20ab68e

Please sign in to comment.