diff options
author | Singal, Kapil (ks220y) <ks220y@att.com> | 2020-09-15 09:51:24 -0400 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2020-09-15 18:54:56 +0000 |
commit | 9c1c061c8e80f41f3838dfaf487b54af36ad8071 (patch) | |
tree | 718f3303554ca014ed9cf9378c01b0888e0e3a20 | |
parent | 00618f56efbdd683430397e0336a016acdca4c6f (diff) |
Fixing DockerFiles
Copying starting script to respective dir as root and then running as user onap
Issue-ID: CCSDK-2794
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: I2b3c27cc8e3a378f9ceeeb0de62f81de9fc38c6b
-rwxr-xr-x | ms/blueprintsprocessor/application/src/main/docker/Dockerfile | 13 | ||||
-rw-r--r-- | ms/command-executor/src/main/docker/Dockerfile | 13 | ||||
-rw-r--r-- | ms/py-executor/docker/Dockerfile | 6 | ||||
-rwxr-xr-x | ms/sdclistener/distribution/src/main/docker/Dockerfile | 9 |
4 files changed, 23 insertions, 18 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/docker/Dockerfile b/ms/blueprintsprocessor/application/src/main/docker/Dockerfile index 751d6a5eb..b0efcbe36 100755 --- a/ms/blueprintsprocessor/application/src/main/docker/Dockerfile +++ b/ms/blueprintsprocessor/application/src/main/docker/Dockerfile @@ -1,22 +1,23 @@ FROM alpine:latest AS extractor COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz + RUN tar -xzf /source.tar.gz -C /tmp \ && cp -rf /tmp/@project.build.finalName@/opt / \ && rm -rf /source.tar.gz \ && rm -rf /tmp/@project.build.finalName@ FROM onap/ccsdk-alpine-j11-image:1.0.1 + USER root # add entrypoint -COPY startService.sh /startService.sh -RUN chown onap:onap /startService.sh \ +COPY startService.sh /opt/app/onap/blueprints-processor/startService.sh +RUN chown onap:onap /opt/app/onap/blueprints-processor/startService.sh \ && touch /velocity.log && chmod 755 /velocity.log && chown onap:onap /velocity.log \ - && chmod 755 /startService.sh -# dos2unix /startService.sh is redundant. Pls fix your git settings! + && chmod 755 /opt/app/onap/blueprints-processor/startService.sh # add application COPY --from=extractor /opt /opt RUN mkdir -p /opt/app/onap/blueprints/deploy && chown onap:onap /opt -R -USER onap -ENTRYPOINT [ "/startService.sh" ] +USER onap +ENTRYPOINT [ "/opt/app/onap/blueprints-processor/startService.sh" ] diff --git a/ms/command-executor/src/main/docker/Dockerfile b/ms/command-executor/src/main/docker/Dockerfile index 1e5d4cbb8..7ef689728 100644 --- a/ms/command-executor/src/main/docker/Dockerfile +++ b/ms/command-executor/src/main/docker/Dockerfile @@ -1,14 +1,14 @@ -FROM python:3.6-slim +FROM onap/integration-python:7.0.1 +USER root ENV GRPC_PYTHON_VERSION 1.20.0 + RUN python -m pip install --upgrade pip RUN pip install grpcio==${GRPC_PYTHON_VERSION} grpcio-tools==${GRPC_PYTHON_VERSION} RUN pip install virtualenv==16.7.9 -RUN groupadd -r -g 1000 onap && useradd -r -u 1000 -g onap onap - -COPY start.sh /opt/app/onap/start.sh -RUN chmod u+x /opt/app/onap/start.sh +COPY start.sh /opt/app/onap/command-executor/start.sh \ + && chmod u+x /opt/app/onap/command-executor/start.sh RUN mkdir -p /opt/app/onap/logs/ && touch /opt/app/onap/logs/application.log @@ -22,5 +22,6 @@ RUN mkdir -p /opt/app/onap/blueprints/deploy RUN chown onap:onap /opt -R VOLUME /opt/app/onap/blueprints/deploy/ + USER onap -ENTRYPOINT /opt/app/onap/start.sh +ENTRYPOINT /opt/app/onap/command-executor/start.sh diff --git a/ms/py-executor/docker/Dockerfile b/ms/py-executor/docker/Dockerfile index eb43b7320..812922c4d 100644 --- a/ms/py-executor/docker/Dockerfile +++ b/ms/py-executor/docker/Dockerfile @@ -1,7 +1,6 @@ -FROM python:3.7-slim - -RUN groupadd -r -g 1000 onap && useradd -u 1000 -r -g onap onap +FROM onap/integration-python:7.0.1 +USER root RUN mkdir -p /opt/app/onap/logs/ && touch /opt/app/onap/logs/application.log COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz @@ -16,5 +15,6 @@ RUN mkdir -p /opt/app/onap/blueprints/deploy RUN chown onap:onap /opt -R VOLUME /opt/app/onap/blueprints/deploy/ + USER onap ENTRYPOINT /opt/app/onap/python/start.sh diff --git a/ms/sdclistener/distribution/src/main/docker/Dockerfile b/ms/sdclistener/distribution/src/main/docker/Dockerfile index b5b74e11e..b001a6fa4 100755 --- a/ms/sdclistener/distribution/src/main/docker/Dockerfile +++ b/ms/sdclistener/distribution/src/main/docker/Dockerfile @@ -1,8 +1,11 @@ FROM onap/ccsdk-alpine-j11-image:1.0.1 +USER root # add entrypoint -COPY startService.sh /startService.sh -RUN chown onap:onap /startService.sh && chmod 755 /startService.sh +COPY startService.sh /opt/app/onap/sdc-listener/startService.sh +RUN chown onap:onap /opt/app/onap/sdc-listener/startService.sh \ + && chmod 755 /opt/app/onap/sdc-listener/startService.sh + # add application COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz RUN tar -xzf /source.tar.gz -C /tmp \ @@ -13,4 +16,4 @@ RUN tar -xzf /source.tar.gz -C /tmp \ && chown onap:onap /opt -R USER onap -ENTRYPOINT /startService.sh +ENTRYPOINT /opt/app/onap/sdc-listener/startService.sh |