diff options
author | 2021-03-19 15:08:22 -0400 | |
---|---|---|
committer | 2021-03-29 14:31:39 +0000 | |
commit | 11687d2f164326e65b2d038563bc9dcda5e42acc (patch) | |
tree | 5f44c0934e3997b09bd0edd00409dbbfae3ad20d /ms/sdclistener/distribution/src/main | |
parent | 53341bfd9e0ed5511ae5246cecc6a840e0dd1136 (diff) |
Fixing DockerFile to avoid IOException
chown on /opt isn't enough as files/directory permissions needs change so that onap user can access to execute
Even if chown onap:onap was done, it was failing to create/run script due to permission issues
Adding noCache to docker-maven-plugin so that it won't pick cached layers
Issue-ID: CCSDK-3224
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: Idf56465eff6fa42b523bccfca56f84e93496a8d2
Diffstat (limited to 'ms/sdclistener/distribution/src/main')
-rwxr-xr-x | ms/sdclistener/distribution/src/main/docker/Dockerfile | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/ms/sdclistener/distribution/src/main/docker/Dockerfile b/ms/sdclistener/distribution/src/main/docker/Dockerfile index b9c61090d..3b5dc4f5b 100755 --- a/ms/sdclistener/distribution/src/main/docker/Dockerfile +++ b/ms/sdclistener/distribution/src/main/docker/Dockerfile @@ -1,8 +1,12 @@ -FROM onap/ccsdk-alpine-j11-image:1.1.0 +# Prepare stage for multistage image build +## START OF STAGE0 ## +FROM onap/ccsdk-alpine-j11-image:1.1.2 AS stage0 USER root + # add entrypoint -COPY startService.sh /opt/app/onap/sdc-listener/startService.sh +COPY *.sh /opt/app/onap/sdc-listener/ + # add application COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz @@ -11,8 +15,17 @@ RUN tar -xzf /source.tar.gz -C /tmp \ && rm -rf /source.tar.gz \ && rm -rf /tmp/@project.build.finalName@ \ && mkdir -p /opt/app/onap/cds-sdc-listener \ - && chown onap:onap /opt -R \ - && chmod 755 /opt/app/onap/sdc-listener/startService.sh + && chown -R onap:onap /opt \ + && chmod -R 755 /opt + +## END OF STAGE0 ## + + +## This will create actual image +FROM onap/ccsdk-alpine-j11-image:1.1.2 +USER root + +COPY --from=stage0 /opt /opt USER onap ENTRYPOINT /opt/app/onap/sdc-listener/startService.sh |