Skip to content
Snippets Groups Projects
Commit fa256cdc authored by Yunhua Koglin's avatar Yunhua Koglin
Browse files

Merge branch 'dockeruser' into 'master'

Use USER command in Dockerfile to run app with non-root user

See merge request !956
parents 05780e42 7efd1719
No related branches found
No related tags found
1 merge request!956Use USER command in Dockerfile to run app with non-root user
Pipeline #293133 failed
......@@ -15,7 +15,10 @@
# https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html
FROM public.ecr.aws/amazoncorretto/amazoncorretto:17
RUN yum update -y
RUN yum update -y && yum install -y shadow-utils
RUN groupadd -g 10001 -r appgroup \
&& useradd -M -g 10001 -r -u 10001 appuser
ARG JAR_FILE=provider/storage-aws/target/*spring-boot.jar
......@@ -26,5 +29,6 @@ COPY ${JAR_FILE} app.jar
COPY /provider/storage-aws/build-aws/entrypoint.sh /entrypoint.sh
EXPOSE 8080
ENTRYPOINT ["/bin/sh", "-c", ". /entrypoint.sh"]
USER 10001:10001
ENTRYPOINT ["/bin/sh", "-c", ". /entrypoint.sh"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment