diff options
Diffstat (limited to 'components/pm-subscription-handler/Dockerfile')
-rw-r--r-- | components/pm-subscription-handler/Dockerfile | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/components/pm-subscription-handler/Dockerfile b/components/pm-subscription-handler/Dockerfile index f1545440..9e3ebfe8 100644 --- a/components/pm-subscription-handler/Dockerfile +++ b/components/pm-subscription-handler/Dockerfile @@ -17,9 +17,10 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END===================================================== -FROM python:3.8.2-alpine3.11 as build -MAINTAINER lego@est.tech +FROM nexus3.onap.org:10001/onap/integration-python:8.0.0 as build +LABEL maintainer="lego@est.tech" +USER root RUN set -eux; \ apk add \ build-base \ @@ -31,17 +32,18 @@ COPY requirements.txt ./ RUN pip install --prefix /opt -r requirements.txt --no-cache-dir # Second stage -FROM python:3.8.2-alpine3.11 +FROM nexus3.onap.org:10001/onap/integration-python:8.0.0 COPY --from=build /opt /opt +USER root ARG user=onap ARG group=onap # set PATH & PYTHONPATH vars ENV APPDIR="/opt/app/pmsh" \ - LD_LIBRARY_PATH=/opt/lib:/opt/lib64 \ - PYTHONPATH=${APPDIR}/mod:/opt/lib/python3.8/site-packages \ + LD_LIBRARY_PATH=/opt/lib \ + PYTHONPATH=${APPDIR}/mod:/opt/lib/python3.9/site-packages \ PATH=$PATH:${APPDIR}/bin \ LOGS_PATH="/var/log/ONAP/dcaegen2/services/pmsh" \ LOGGER_CONFIG="/opt/app/pmsh/log_config.yaml" @@ -50,13 +52,14 @@ WORKDIR $APPDIR RUN mkdir -p $APPDIR RUN set -eux; \ - apk add --no-cache postgresql-libs nano + apk add --no-cache postgresql-libs COPY ./pmsh_service ./bin COPY log_config.yaml ./ -# Create a group and user -RUN addgroup -S $group && adduser -S -D -h /home/$user $user $group && \ +# onap user & group already avaliable, create home dir +RUN mkdir -p /home/$user && \ + chown -R $user:$group /home/$user && \ mkdir -p ${LOGS_PATH} && \ chown -R $user:$group ${LOGS_PATH} && \ chown -R $user:$group ${APPDIR} @@ -64,4 +67,4 @@ RUN addgroup -S $group && adduser -S -D -h /home/$user $user $group && \ # Tell docker that all future commands should be run as the onap user USER $user -ENTRYPOINT ["python", "/opt/app/pmsh/bin/pmsh_service_main.py"]
\ No newline at end of file +ENTRYPOINT ["python", "/opt/app/pmsh/bin/pmsh_service_main.py"] |