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 3a32227 fix problem: can not build docker (#684)
3a32227 is described below
commit 3a32227ecc38b431c725209a0a413524eec3992f
Author: Shawn <[email protected]>
AuthorDate: Thu Sep 3 18:27:18 2020 +0800
fix problem: can not build docker (#684)
---
Dockerfile.build | 6 +++---
README.md | 11 +++++------
go.sum | 1 +
scripts/build/local.sh | 2 +-
scripts/docker/build-image/build.sh | 19 ++++++++++++++++++-
5 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/Dockerfile.build b/Dockerfile.build
index b52efa7..a21740c 100644
--- a/Dockerfile.build
+++ b/Dockerfile.build
@@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM golang:1.11.2
+FROM golang:1.14
WORKDIR /go/src/github.com/apache/servicecomb-service-center
COPY . .
-
-RUN bash -x scripts/build/local.sh linux 1.1.0 latest
+RUN export GOPROXY=https://goproxy.io
+RUN bash -x scripts/build/local.sh linux 1.4.0 latest
diff --git a/README.md b/README.md
index f8df5d8..408ecc8 100644
--- a/README.md
+++ b/README.md
@@ -107,19 +107,14 @@ you can download dependencies directly using command `go
mod`. Please follow bel
download all the dependency.
```sh
-# greater then go1.11
GO111MODULE=on go mod download
GO111MODULE=on go mod vendor
```
-
Build the Service-Center
-
```sh
go build -o service-center
github.com/apache/servicecomb-service-center/cmd/scserver
```
-
First, you need to run a etcd(version: 3.x) as a database service and then
modify the etcd IP and port in the Service Center configuration file
(./etc/conf/app.conf : manager_cluster).
-
```sh
wget
https://github.com/coreos/etcd/releases/download/v3.1.8/etcd-v3.1.8-linux-amd64.tar.gz
tar -xvf etcd-v3.1.8-linux-amd64.tar.gz
@@ -133,7 +128,11 @@ cp -r ./etc/conf .
This will bring up Service Center listening on ip/port 127.0.0.1:30100 for
service communication.If you want to change the listening ip/port, you can
modify it in the Service Center configuration file (./conf/app.conf :
httpaddr,httpport).
[github-release]: https://github.com/servicecomb/service-center/releases/
-
+### Build docker image
+```sh
+sudo bash scripts/docker/build-image/build.sh
+```
+it builds a image servicecomb/service-center
### Running Frontend using the Release
You can download our latest release from ServiceComb Website and then untar it
and run start-frontend.sh/start-frontend.bat.
diff --git a/go.sum b/go.sum
index 5b11bfe..87ef0ae 100644
--- a/go.sum
+++ b/go.sum
@@ -129,6 +129,7 @@ github.com/go-chassis/go-chassis
v0.0.0-20200709095636-48e710908928 h1:y464C11Tr
github.com/go-chassis/go-chassis v0.0.0-20200709095636-48e710908928/go.mod
h1:S7RbnpeTWBqZ4+UxGAs05a6qdhDyWKpTNuil8FYNiME=
github.com/go-chassis/go-chassis v0.0.0-20200716073336-4183d5dd1246
h1:yxtoclu0QclYtwXxo4AYTCPJsYFM/Xo2/5C1HLRnzqg=
github.com/go-chassis/go-chassis v0.0.0-20200716073336-4183d5dd1246/go.mod
h1:S7RbnpeTWBqZ4+UxGAs05a6qdhDyWKpTNuil8FYNiME=
+github.com/go-chassis/go-chassis v0.0.0-20200820073047-a1c634b7bdd1
h1:eAGcefnlCeBi8+01Bokh6nmRR/PjrC3QCqPRUarv6dw=
github.com/go-chassis/go-chassis v0.0.0-20200820073047-a1c634b7bdd1/go.mod
h1:nMWwWrgDEyDKnMQLE5Gt65RdwbgrQg5amt4BqNFY09g=
github.com/go-chassis/go-chassis v1.8.1/go.mod
h1:vI0rU2FNAtGi6owfYKXBVj6cvq633/n+8bqbsVfib7E=
github.com/go-chassis/go-chassis v1.8.2-0.20200620015240-3621ca234c7c
h1:Bu4xdnLMGYmupX5E6dV34fFOvEo3p0trcKQsThqyXAA=
diff --git a/scripts/build/local.sh b/scripts/build/local.sh
index 5a5fd6b..2dfb536 100644
--- a/scripts/build/local.sh
+++ b/scripts/build/local.sh
@@ -16,7 +16,7 @@
# limitations under the License.
set -e
-
+export GOPROXY=https://goproxy.io
export GOOS=${1:-"linux"}
export GOARCH=${4:-"amd64"}
export CGO_ENABLED=${CGO_ENABLED:-0} # prevent to compile cgo file
diff --git a/scripts/docker/build-image/build.sh
b/scripts/docker/build-image/build.sh
index 7ba7d9f..c22d1b7 100644
--- a/scripts/docker/build-image/build.sh
+++ b/scripts/docker/build-image/build.sh
@@ -30,8 +30,25 @@ PACKAGE_PREFIX=apache-servicecomb-service-center
PACKAGE_DIR=$SCRIPT_DIR/../$PACKAGE_PREFIX-$PACKAGE-linux-amd64
-source ${SCRIPT_DIR}/../../build/tools.sh
+docker_builder_pattern() {
+ local dockerfile_dir=${1:-"."}
+ local output=${2:-"."}
+ local builder_name=servicecomb/service-center:build
+ local builder_path=/go/src/github.com/apache/servicecomb-service-center
+ local app=$PACKAGE_PREFIX-$PACKAGE-linux-amd64
+ set +e
+
+ docker rmi $builder_name
+
+ set -e
+
+ cd $dockerfile_dir
+ docker build -t $builder_name . -f Dockerfile.build
+ docker create --name builder $builder_name
+ docker cp builder:$builder_path/$app $output
+ docker rm -f builder
+}
if [ ! -d $PACKAGE_DIR ]; then
docker_builder_pattern $BASE_DIR $SCRIPT_DIR/../
fi