Skip to content
Snippets Groups Projects
Commit 1b8824e8 authored by Danylo Vanin (EPAM)'s avatar Danylo Vanin (EPAM) Committed by Mikhail Piatliou (EPAM)
Browse files

[GONRG-7391] Move image to non-root approach

parent 6cc3815d
No related branches found
No related tags found
1 merge request!284[GONRG-7391] Move image to non-root approach
......@@ -30,7 +30,7 @@ spec:
name: {{ .Values.conf.configmap | quote }}
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
runAsNonRoot: true
ports:
- containerPort: 8080
resources:
......
......@@ -5,5 +5,12 @@ ENV PORT $PORT
# Copy the jar to the production image from the builder stage.
COPY provider/unit-gc/unit-gke/target/unit-gke-*.jar unit.jar
COPY data/unit_catalog_v2.json /mnt/unit_catalogs/unit_catalog_v2.json
# Add a non-root user
RUN groupadd -g 10001 -r nonroot \
&& useradd -g 10001 -r -u 10001 nonroot
# Run as non-root user
USER 10001:10001
# Run the web service on container startup.
CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -Dlog4j.formatMsgNoLookups=true -jar /app/unit.jar
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