This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-kie.git
The following commit(s) were added to refs/heads/master by this push:
new 242cc12 Use alpine base image instead (#180)
242cc12 is described below
commit 242cc129a32f4f80e6f386393638360398fb1a3f
Author: little-cui <[email protected]>
AuthorDate: Tue Apr 20 20:32:15 2021 +0800
Use alpine base image instead (#180)
---
build/build_binary.sh | 7 +++++--
build/docker/server/Dockerfile | 2 +-
scripts/start.sh | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/build/build_binary.sh b/build/build_binary.sh
index 49f5eec..b9c8ee3 100755
--- a/build/build_binary.sh
+++ b/build/build_binary.sh
@@ -16,6 +16,9 @@
echo "GOPATH is "${GOPATH}
export BUILD_DIR=$(cd "$(dirname "$0")"; pwd)
export PROJECT_DIR=$(dirname ${BUILD_DIR})
+export CGO_ENABLED=${CGO_ENABLED:-0} # prevent to compile cgo file
+export GO_EXTLINK_ENABLED=${GO_EXTLINK_ENABLED:-0} # do not use host linker
+export GO_LDFLAGS=${GO_LDFLAGS:-" -s -w"}
echo "downloading dependencies"
cd ${PROJECT_DIR}
GO111MODULE=on go mod vendor
@@ -86,9 +89,9 @@ buildAndPackage(){
GOARCH=$2
echo "building & packaging ${GOOS} ${GOARCH}..."
if [ "$GOOS" = "windows" ]; then
- GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${release_dir}/kie.exe
github.com/apache/servicecomb-kie/cmd/kieserver
+ GOOS=${GOOS} GOARCH=${GOARCH} go build --ldflags "${GO_LDFLAGS}" -o
${release_dir}/kie.exe github.com/apache/servicecomb-kie/cmd/kieserver
else
- GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${release_dir}/kie
github.com/apache/servicecomb-kie/cmd/kieserver
+ GOOS=${GOOS} GOARCH=${GOARCH} go build --ldflags "${GO_LDFLAGS}" -o
${release_dir}/kie github.com/apache/servicecomb-kie/cmd/kieserver
fi
if [ $? -eq 0 ]; then
diff --git a/build/docker/server/Dockerfile b/build/docker/server/Dockerfile
index 0b3d122..db149b0 100644
--- a/build/docker/server/Dockerfile
+++ b/build/docker/server/Dockerfile
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM ubuntu:19.04
+FROM alpine:latest
RUN mkdir -p /etc/servicecomb-kie/
RUN mkdir -p /opt/servicecomb-kie/conf
diff --git a/scripts/start.sh b/scripts/start.sh
index 0b390bf..be4f0fd 100755
--- a/scripts/start.sh
+++ b/scripts/start.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# 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.