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-service-center.git
The following commit(s) were added to refs/heads/master by this push:
new a13624e Fix: sc not found in alpine (#1091)
a13624e is described below
commit a13624e11f0126417bbd9650a7d185a13fed5292
Author: little-cui <[email protected]>
AuthorDate: Fri Jul 9 15:46:42 2021 +0800
Fix: sc not found in alpine (#1091)
---
scripts/build/tools.sh | 25 ++++++++++++-------------
ux/docker-compose.yml | 4 ++--
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/scripts/build/tools.sh b/scripts/build/tools.sh
index 887997f..883723f 100644
--- a/scripts/build/tools.sh
+++ b/scripts/build/tools.sh
@@ -23,18 +23,17 @@ set -e
export GOPROXY=${GOPROXY:-"https://goproxy.io"}
export GOOS=${GOOS:-"linux"}
export GOARCH=${GOARCH:-"amd64"}
-
-if [ "$GOOS" == "linux" ]; then
- export CGO_ENABLED=${CGO_ENABLED:-1}
+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"}
+if [[ $GOOS == "linux" ]]; then
+ if [[ $CGO_ENABLED == 1 ]]; then
export CGO_CFLAGS="${CGO_CFLAGS} -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -O2"
+ fi
+ if [[ $GO_EXTLINK_ENABLED == 1 ]]; then
export GO_LDFLAGS="${GO_LDFLAGS} -linkmode=external -extldflags
\"-Wl,-z,now\""
- export GOBUILDMODE_OPTS="-buildmode=pie"
-else
- export CGO_ENABLED=${CGO_ENABLED:-0}
+ fi
fi
-
-export GO_EXTLINK_ENABLED=${GO_EXTLINK_ENABLED:-0} # do not use host linker
-export GO_LDFLAGS=${GO_LDFLAGS:-" -s -w"}
# Inputs
export RELEASE=${RELEASE:-"0.0.1"}
export PACKAGE_PREFIX=${PACKAGE_PREFIX:-"apache-servicecomb-service-center"}
@@ -83,7 +82,7 @@ build_frontend() {
if [ "$GOOS" == "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
fi
- go build ${GOBUILDMODE_OPTS} --ldflags "${GO_LDFLAGS}" -o $BINARY_NAME
github.com/apache/servicecomb-service-center/frontend
+ go build ${GO_BUILDMODE} --ldflags "${GO_LDFLAGS}" -o $BINARY_NAME
github.com/apache/servicecomb-service-center/frontend
}
build_service_center() {
@@ -105,7 +104,7 @@ build_service_center() {
if [ "$GOOS" == "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
fi
- go build ${GOBUILDMODE_OPTS} --ldflags "${ldflags}" -o $BINARY_NAME
github.com/apache/servicecomb-service-center/cmd/scserver
+ go build ${GO_BUILDMODE} --ldflags "${ldflags}" -o $BINARY_NAME
github.com/apache/servicecomb-service-center/cmd/scserver
}
build_scctl() {
@@ -120,7 +119,7 @@ build_scctl() {
if [ "$GOOS" == "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
fi
- go build ${GOBUILDMODE_OPTS} --ldflags "${ldflags}" -o $BINARY_NAME
github.com/apache/servicecomb-service-center/cmd/scctl
+ go build ${GO_BUILDMODE} --ldflags "${ldflags}" -o $BINARY_NAME
github.com/apache/servicecomb-service-center/cmd/scctl
}
build_syncer() {
@@ -135,7 +134,7 @@ build_syncer() {
if [ "$GOOS" == "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
fi
- go build ${GOBUILDMODE_OPTS} --ldflags "${ldflags}" -o $BINARY_NAME
github.com/apache/servicecomb-service-center/cmd/syncer
+ go build ${GO_BUILDMODE} --ldflags "${ldflags}" -o $BINARY_NAME
github.com/apache/servicecomb-service-center/cmd/syncer
}
## Prepare the Configuration and Make package
diff --git a/ux/docker-compose.yml b/ux/docker-compose.yml
index 82bd59c..9ba0f08 100644
--- a/ux/docker-compose.yml
+++ b/ux/docker-compose.yml
@@ -39,7 +39,7 @@ services:
condition: service_healthy
service-center:
- image: servicecomb/service-center:2.0.0
+ image: servicecomb/service-center:latest
container_name: sc
ports:
- 30100:30100
@@ -71,4 +71,4 @@ services:
service-center:
condition: service_started
kie:
- condition: service_started
\ No newline at end of file
+ condition: service_started