Add Dockerfile for v2 Microservices 64/107164/6
authorRitu Sood <ritu.sood@intel.com>
Wed, 6 May 2020 04:22:59 +0000 (21:22 -0700)
committerEric Multanen <eric.w.multanen@intel.com>
Wed, 10 Jun 2020 17:08:10 +0000 (10:08 -0700)
Dockerfile for building and running
microservices.

Issue-ID: MULTICLOUD-1065
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Change-Id: I95242d074b1ad1fa446727d849478b041e2f9829

build/Dockerfile [new file with mode: 0644]
build/Readme.md [new file with mode: 0644]
build/entrypoint [new file with mode: 0755]

diff --git a/build/Dockerfile b/build/Dockerfile
new file mode 100644 (file)
index 0000000..ff9e857
--- /dev/null
@@ -0,0 +1,37 @@
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+FROM golang:1.14.1
+
+WORKDIR /go/src/github.com/onap/multicloud-k8s
+COPY ./ ./
+RUN cd src/orchestrator && make all
+RUN cd src/ncm && make all
+RUN cd src/dcm && make all
+RUN cd src/rsync && make all
+RUN cd src/ovnaction && make all
+RUN cd src/clm && make all
+
+FROM ubuntu:16.04
+
+WORKDIR /opt/mco
+RUN groupadd -r mco && useradd -r -g mco mco
+RUN chown mco:mco /opt/mco -R
+COPY --chown=mco --from=0 /go/src/github.com/onap/multicloud-k8s/src/orchestrator/orchestrator ./
+COPY --chown=mco --from=0 /go/src/github.com/onap/multicloud-k8s/src/ncm/ncm ./
+COPY --chown=mco --from=0 /go/src/github.com/onap/multicloud-k8s/src/dcm/dcm ./
+COPY --chown=mco --from=0 /go/src/github.com/onap/multicloud-k8s/src/rsync/rsync ./
+COPY --chown=mco --from=0 /go/src/github.com/onap/multicloud-k8s/src/ovnaction/ovnaction ./
+COPY --chown=mco --from=0 /go/src/github.com/onap/multicloud-k8s/src/clm/clm ./
+COPY --chown=mco --from=0 /go/src/github.com/onap/multicloud-k8s/build/entrypoint ./
+
+USER mco
+
+ENTRYPOINT ["./entrypoint"]
+
diff --git a/build/Readme.md b/build/Readme.md
new file mode 100644 (file)
index 0000000..193c0ea
--- /dev/null
@@ -0,0 +1,4 @@
+# Steps for building v2 API Docker Image
+$cd k8s
+$docker build -f build/Dockerfile . -t mco
+
diff --git a/build/entrypoint b/build/entrypoint
new file mode 100755 (executable)
index 0000000..bafb76e
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh -e
+
+cmd=${1:-""}
+
+case ${cmd} in
+   "mco")
+      ./orchestrator
+      ;;
+
+   "ncm")
+      ./ncm
+      ;;
+
+   "dcm")
+      ./dcm
+      ;;
+
+   "rsync")
+      ./rsync
+      ;;
+
+   "ovnaction")
+      ./ovnaction
+      ;;
+
+   "clm")
+      ./clm
+      ;;
+
+    *)
+      echo "invalid command ${cmd}"
+      sleep infinity
+
+esac
+