Optimize Dockerfile to reduce SDC image size
Use --chown flag at ADD command instead of executing chown
Issue-ID: SDC-2366
Signed-off-by: Satoshi Fujii <fujii-satoshi@jp.fujitsu.com>
Change-Id: I5aa36da91e45bad5f6ae0bd817a3cdf8186668d8
diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile
index f49b284..b499966 100644
--- a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile
+++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile
@@ -4,14 +4,12 @@
COPY chef-repo/cookbooks /root/chef-solo/cookbooks/
-ADD onboarding-be-*.war ${JETTY_BASE}/webapps/
+ADD --chown=jetty:jetty onboarding-be-*.war ${JETTY_BASE}/webapps/
-ADD api-docs.war ${JETTY_BASE}/webapps/
+ADD --chown=jetty:jetty api-docs.war ${JETTY_BASE}/webapps/
USER root
-RUN chown -R jetty:jetty ${JETTY_BASE}/webapps
-
COPY startup.sh /root/
RUN chmod 770 /root/startup.sh