Update Dockerfile for PF base image 78/133278/1
authorliamfallon <liam.fallon@est.tech>
Tue, 14 Feb 2023 11:35:40 +0000 (11:35 +0000)
committerliamfallon <liam.fallon@est.tech>
Tue, 14 Feb 2023 11:35:43 +0000 (11:35 +0000)
The Policy Framework base image run under the "onap" user rather than
under the "root" user. This means that root access has to be enabled in
child Dockerfiles for configuraiton that requires root access.

Root access is turned off again later in the Dockerfile so that the
image will run under another user.

Issue-ID: POLICY-4558
Change-Id: I2c4268e78219a77991c7e0dcdea49e193cc873cd
Signed-off-by: liamfallon <liam.fallon@est.tech>
packages/policy-distribution-docker/src/main/docker/Dockerfile

index 73a0ab6..49d025f 100644 (file)
@@ -2,7 +2,7 @@
 # Dockerfile
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-#  Modifications Copyright (C) 2022 Nordix Foundation.
+#  Modifications Copyright (C) 2022-2023 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@ ARG POLICY_LOGS=/var/log/onap/policy/distribution
 ENV POLICY_LOGS=$POLICY_LOGS
 ENV POLICY_HOME=$POLICY_HOME/distribution
 
+USER root
 RUN mkdir -p $POLICY_HOME $POLICY_LOGS && \
     chown -R policy:policy $POLICY_HOME $POLICY_LOGS