add support to generate docker image for artifactbroker
. add Dockerfile to describe the docker image steps
. add build_image.sh to wrap the generation of image
. Use Alpine as base docker image in distribution to make
it small
Change-Id: I8a2c8321be176d549063e6ab296adcacb46b9ad3
Issue-ID: MULTICLOUD-548
Signed-off-by: liboNet <libo.zhu@intel.com>
diff --git a/artifactbroker/docker/Dockerfile b/artifactbroker/docker/Dockerfile
new file mode 100644
index 0000000..008a3c1
--- /dev/null
+++ b/artifactbroker/docker/Dockerfile
@@ -0,0 +1,41 @@
+FROM alpine:3.9
+
+ARG HTTP_PROXY=${HTTP_PROXY}
+ARG HTTPS_PROXY=${HTTPS_PROXY}
+ARG BUILD_VERSION=${BUILD_VERSION}
+ARG ARTIFACT_LOGS=/var/log/onap
+
+ENV http_proxy $HTTP_PROXY
+ENV https_proxy $HTTPS_PROXY
+ENV BUILD_VERSION ${BUILD_VERSION}
+ENV ARTIFACT_LOGS ${ARTIFACT_LOGS}
+
+ENV ARTIFACT_HOME=/opt/app/
+ENV ARTIFACT_DISTRIBUTION_HOME=${ARTIFACT_HOME}/distribution
+
+EXPOSE 9014
+
+RUN apk add --no-cache --update busybox-extras bash nss procps coreutils findutils grep zip unzip \
+ curl wget openssh openjdk8 maven jq httpie py-pip
+
+RUN addgroup -S onap && \
+ adduser -S --shell /bin/bash -G onap onap
+
+RUN mkdir -p ${ARTIFACT_DISTRIBUTION_HOME} ${ARTIFACT_LOGS} ${ARTIFACT_HOME}/etc/ssl && \
+ chown -R onap:onap ${ARTIFACT_HOME} ${ARTIFACT_DISTRIBUTION_HOME} ${ARTIFACT_LOGS}
+
+WORKDIR ${ARTIFACT_DISTRIBUTION_HOME}
+RUN wget -O multicloud-framework-artifactbroker-package-1.3.0-SNAPSHOT.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=autorelease-121669&g=org.onap.multicloud.framework&a=multicloud-framework-artifactbroker-package&v=1.3.0&e=zip" && \
+ unzip -q -o -B multicloud-framework-artifactbroker-package-1.3.0-SNAPSHOT.zip && \
+ rm -f multicloud-framework-artifactbroker-package-1.3.0-SNAPSHOT.zip
+COPY artifact-dist.sh bin/.
+#RUN tar xvfz /packages/policy-distribution.tar.gz --directory ${ARTIFACT_DISTRIBUTION_HOME}
+#RUN rm /packages/policy-distribution.tar.gz
+
+RUN chmod +x bin/*.sh && \
+ cp ${ARTIFACT_DISTRIBUTION_HOME}/etc/ssl/* ${ARTIFACT_HOME}/etc/ssl && \
+ chown onap:onap ${ARTIFACT_HOME}/etc/ssl/*
+
+USER onap
+WORKDIR ${ARTIFACT_DISTRIBUTION_HOME}/bin
+ENTRYPOINT [ "bash", "./artifact-dist.sh" ]