You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2021/05/22 04:03:16 UTC
[servicecomb-service-center] branch master updated: SCB-2176 Fix:
failed to build image (#999)
This is an automated email from the ASF dual-hosted git repository.
littlecui 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 cfd8c48 SCB-2176 Fix: failed to build image (#999)
cfd8c48 is described below
commit cfd8c4804f1713f73084ffd837d8d562893a90e7
Author: little-cui <su...@qq.com>
AuthorDate: Sat May 22 12:03:06 2021 +0800
SCB-2176 Fix: failed to build image (#999)
---
Dockerfile.build | 2 +-
deployments/db.js | 29 ----------------------
examples/dev/conf/app.yaml | 2 +-
examples/infrastructures/docker/docker-compose.yml | 2 --
scripts/build/tools.sh | 1 +
scripts/docker/build-image/build.sh | 2 +-
scripts/docker/build-image/start.sh | 17 ++++++++-----
7 files changed, 15 insertions(+), 40 deletions(-)
diff --git a/Dockerfile.build b/Dockerfile.build
index 10ad313..de082ba 100644
--- a/Dockerfile.build
+++ b/Dockerfile.build
@@ -21,4 +21,4 @@ ENV GOPROXY https://goproxy.io
COPY . .
-RUN bash -x scripts/build/local.sh linux 2.0.0 amd64 {{BUILD}}
+RUN bash -x scripts/build/local.sh linux {{RELEASE}} amd64 {{BUILD}}
diff --git a/deployments/db.js b/deployments/db.js
deleted file mode 100644
index 5521563..0000000
--- a/deployments/db.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.
- */
-
-db.createUser(
- {
- user: "sc",
- pwd: "123",
- roles: [
- {
- role: "readWrite",
- db: "servicecenter"
- }
- ]
- }
-);
\ No newline at end of file
diff --git a/examples/dev/conf/app.yaml b/examples/dev/conf/app.yaml
index 03ad5f4..999f0df 100644
--- a/examples/dev/conf/app.yaml
+++ b/examples/dev/conf/app.yaml
@@ -120,7 +120,7 @@ registry:
workerNum: 10
timeout: 10
cluster:
- uri: mongodb://sc:123@localhost:27017
+ uri: mongodb://localhost:27017
sslEnabled: false
rootCAFile: /opt/ssl/ca.pem
verifyPeer: false
diff --git a/examples/infrastructures/docker/docker-compose.yml b/examples/infrastructures/docker/docker-compose.yml
index b54a210..8a3b5b3 100644
--- a/examples/infrastructures/docker/docker-compose.yml
+++ b/examples/infrastructures/docker/docker-compose.yml
@@ -51,8 +51,6 @@ services:
# restart: always
ports:
- "30100:30100"
- # environment:
- # BACKEND_ADDRESS: etcd:2379
scfrontend:
depends_on:
diff --git a/scripts/build/tools.sh b/scripts/build/tools.sh
index c4c71fb..a9c5099 100644
--- a/scripts/build/tools.sh
+++ b/scripts/build/tools.sh
@@ -183,6 +183,7 @@ docker_builder_pattern() {
cd $dockerfile_dir
cp -pf Dockerfile.build Dockerfile
+ sed -i "s|{{RELEASE}}|${RELEASE}|g" Dockerfile
sed -i "s|{{BUILD}}|${BUILD}|g" Dockerfile
docker build -t $builder_name .
docker create --name builder $builder_name
diff --git a/scripts/docker/build-image/build.sh b/scripts/docker/build-image/build.sh
index fd815d1..3833615 100644
--- a/scripts/docker/build-image/build.sh
+++ b/scripts/docker/build-image/build.sh
@@ -24,7 +24,7 @@ SCRIPT_DIR=$(cd $(dirname $0); pwd)
BASE_DIR=${SCRIPT_DIR}/../../../
# build all
-export RELEASE=${1:-"latest"}
+export RELEASE=${1:-"2.0.0"}
source ${SCRIPT_DIR}/../../build/tools.sh
diff --git a/scripts/docker/build-image/start.sh b/scripts/docker/build-image/start.sh
index a8d7c73..e2c5d41 100644
--- a/scripts/docker/build-image/start.sh
+++ b/scripts/docker/build-image/start.sh
@@ -21,12 +21,17 @@ umask 027
cd /opt/service-center
-set +e
-sed -i "s/^httpaddr.*=.*$/httpaddr = $(hostname)/g" conf/app.conf
-if [ ! -z "${BACKEND_ADDRESS}" ]; then
- sed -i "s|^registry_plugin.*=.*$|registry_plugin = etcd|g" conf/app.conf
- sed -i "s|^manager_cluster.*=.*$|manager_cluster = ${BACKEND_ADDRESS}|g" conf/app.conf
+export SERVER_HOST="$(hostname)"
+export LOG_FILE=${LOG_FILE:-''}
+export LOG_LEVEL=${LOG_LEVEL:-'DEBUG'}
+if [ -z "${BACKEND_ADDRESS}" ]; then
+ export REGISTRY_KIND=${REGISTRY_KIND:-'embeded_etcd'}
+ export REGISTRY_ETCD_CLUSTER_NAME=${REGISTRY_ETCD_CLUSTER_NAME:-'sc-0'}
+ export REGISTRY_ETCD_CLUSTER_MANAGER_ENDPOINTS=${REGISTRY_ETCD_CLUSTER_MANAGER_ENDPOINTS:-'http://127.0.0.1:2380'}
+ export REGISTRY_ETCD_CLUSTER_ENDPOINTS=${REGISTRY_ETCD_CLUSTER_ENDPOINTS:-'sc-0=http://127.0.0.1:2380'}
+else
+ export REGISTRY_KIND=${REGISTRY_KIND:-'etcd'}
+ export REGISTRY_ETCD_CLUSTER_ENDPOINTS=${BACKEND_ADDRESS}
fi
-set -e
./service-center
\ No newline at end of file