This is an automated email from the ASF dual-hosted git repository.

liuxun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b5b548  SUBMARINE-362. Add Submarine operator dockerfile
5b5b548 is described below

commit 5b5b54815d16c9c2ee9aaacdd394176056f84dac
Author: Xun Liu <[email protected]>
AuthorDate: Mon Jan 27 17:13:51 2020 +0800

    SUBMARINE-362. Add Submarine operator dockerfile
    
    ### What is this PR for?
    Provide dockerfile and build scripts for the submarine operator,
    Convenient for making submarine-operator docker image.
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/SUBMARINE-362
    
    ### How should this be tested?
    * https://travis-ci.org/liuxunorg/submarine/builds/642284635
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Xun Liu <[email protected]>
    
    Closes #165 from liuxunorg/SUBMARINE-362 and squashes the following commits:
    
    e15cb30 [Xun Liu] SUBMARINE-362. Add Submarine operator dockerfile
---
 dev-support/docker-images/operator/Dockerfile | 26 ++++++++++++++
 dev-support/docker-images/operator/build.sh   | 50 +++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)

diff --git a/dev-support/docker-images/operator/Dockerfile 
b/dev-support/docker-images/operator/Dockerfile
new file mode 100644
index 0000000..aa096fc
--- /dev/null
+++ b/dev-support/docker-images/operator/Dockerfile
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM alpine:3.10
+MAINTAINER Apache Software Foundation <[email protected]>
+
+# Update apk repositories
+RUN echo "http://mirrors.ustc.edu.cn/alpine/v3.10/main"; > /etc/apk/repositories
+RUN echo "http://mirrors.ustc.edu.cn/alpine/v3.10/community"; >> 
/etc/apk/repositories
+
+RUN apk add tzdata --no-cache
+ADD ./tmp/submarine-operator_linux /usr/local/bin/submarine-operator_linux
+
+ENTRYPOINT [ "/usr/local/bin/submarine-operator_linux" ]
diff --git a/dev-support/docker-images/operator/build.sh 
b/dev-support/docker-images/operator/build.sh
new file mode 100755
index 0000000..fd244c6
--- /dev/null
+++ b/dev-support/docker-images/operator/build.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+SUBMARINE_VERSION=0.3.0-SNAPSHOT
+SUBMARINE_IMAGE_NAME="apache/submarine:operator-${SUBMARINE_VERSION}"
+
+if [ -L ${BASH_SOURCE-$0} ]; then
+  PWD=$(dirname $(readlink "${BASH_SOURCE-$0}"))
+else
+  PWD=$(dirname ${BASH_SOURCE-$0})
+fi
+export CURRENT_PATH=$(cd "${PWD}">/dev/null; pwd)
+export SUBMARINE_HOME=${CURRENT_PATH}/../../..
+
+if [ ! -d "${SUBMARINE_HOME}/submarine-cloud/target" ]; then
+  mkdir "${SUBMARINE_HOME}/submarine-cloud/target"
+fi
+submarine_operator_exists=$(find -L "${SUBMARINE_HOME}/submarine-cloud/target" 
-name "submarine-operator_linux")
+# Build source code if the package doesn't exist.
+if [[ -z "${submarine_operator_exists}" ]]; then
+  cd "${SUBMARINE_HOME}/submarine-cloud"
+  export GOOS=linux
+  mvn clean package -DskipTests
+fi
+
+mkdir -p "${CURRENT_PATH}/tmp"
+cp ${SUBMARINE_HOME}/submarine-cloud/target/submarine-operator_linux 
"${CURRENT_PATH}/tmp"
+
+# build image
+cd ${CURRENT_PATH}
+echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
+docker build -t ${SUBMARINE_IMAGE_NAME} .
+
+# clean temp file
+rm -rf "${CURRENT_PATH}/tmp"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to