From cdfead0576be9d2dec040d33c31e3f7af00d3097 Mon Sep 17 00:00:00 2001 From: Jiman <kimjiman@amazon.com> Date: Wed, 6 Nov 2024 10:28:52 -0800 Subject: [PATCH] add USER into dockerfile --- provider/schema-aws/build-aws/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/provider/schema-aws/build-aws/Dockerfile b/provider/schema-aws/build-aws/Dockerfile index 2b0890b18..1da4d02de 100644 --- a/provider/schema-aws/build-aws/Dockerfile +++ b/provider/schema-aws/build-aws/Dockerfile @@ -15,6 +15,10 @@ # https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html FROM amazoncorretto:17 +RUN yum update -y && yum install -y shadow-utils \ + && groupadd -g 10001 -r appgroup \ + && useradd -M -g 10001 -r -u 10001 appuser + ARG JAR_FILE=provider/schema-aws/target/*-spring-boot.jar @@ -23,4 +27,5 @@ COPY ${JAR_FILE} app.jar COPY /provider/schema-aws/build-aws/entrypoint.sh /entrypoint.sh EXPOSE 8080 +USER 10001:10001 ENTRYPOINT ["/bin/sh", "-c", ". /entrypoint.sh"] -- GitLab