You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/02/28 11:06:27 UTC

[dubbo-go-pixiu] branch develop updated: add docker example in readme

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

alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu.git


The following commit(s) were added to refs/heads/develop by this push:
     new 7d3ddfd  add docker example in readme
     new 6131cee  Merge pull request #370 from phial3/develop
7d3ddfd is described below

commit 7d3ddfd7a0813f74f347ea2294354b23b063304e
Author: gaoyanfei3 <ga...@jd.com>
AuthorDate: Sun Feb 27 18:57:13 2022 +0800

    add docker example in readme
---
 Makefile                                           |  7 +++--
 README.md                                          | 33 +++++++++++++++++++--
 README_CN.md                                       | 34 ++++++++++++++++++++--
 .../dubbogo/simple/resolve/server/app/server.go    |  4 +--
 4 files changed, 70 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 75a2109..c8d1fbd 100644
--- a/Makefile
+++ b/Makefile
@@ -62,11 +62,14 @@ image:
 		-t apache/$(targetName):latest \
 		-t apache/$(targetName):$(VERSION) \
 		--build-arg build=$(BUILD) --build-arg version=$(VERSION) \
-		-f Dockerfile --no-cache .
+		-f Dockerfile --no-cache --platform linux/amd64 .
 
 test:
 	sh before_ut.sh
 	go test ./pkg/... -coverprofile=coverage.txt -covermode=atomic
 
 integrate-test:
-	sh start_integrate_test.sh
\ No newline at end of file
+	sh start_integrate_test.sh
+
+clean:
+	@rm -rf ./dubbo-go-pixiu
\ No newline at end of file
diff --git a/README.md b/README.md
index 29a87ee..4d762f6 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ It supports **HTTP-to-Dubbo** and **HTTP-to-HTTP** proxy and more protocols will
 #### cd samples dir
 
 ```
-cd samples/dubbo/simple
+cd samples/dubbogo/simple
 ```
 
 we can use start.sh to run samples quickly. for more info, execute command as below for more help
@@ -55,7 +55,7 @@ if prepare config file manually, notice:
 if run pixiu manually, use command as below
 
 ```
- go run cmd/pixiu/*.go gateway start -c /[absolute-path]/dubbo-go-pixiu/samples/dubbo/simple/body/pixiu/conf.yaml
+ go run cmd/pixiu/*.go gateway start -c /[absolute-path]/dubbo-go-pixiu/samples/dubbogo/simple/body/pixiu/conf.yaml
 ```
 
 
@@ -74,6 +74,35 @@ curl -X POST 'localhost:8881/api/v1/test-dubbo/user' -d '{"id":"0003","code":3,"
 ./start.sh clean body
 ```
 
+## Start Docker
+
+#### 
+```shell
+docker pull phial3/dubbo-go-pixiu:latest
+```
+```
+docker run --name pixiuname -p 8883:8883 \
+    -v /yourpath/conf.yaml:/etc/pixiu/conf.yaml \
+    -v /yourpath/log.yml:/etc/pixiu/log.yml \
+    apache/dubbo-go-pixiu:latest
+```
+#### http to dubbo samples
+start provider, zookeeper be used register center.
+```shell
+cd samples/dubbogo/simple/resolve/server
+
+export DUBBO_GO_CONFIG_PATH="../profiles/dev/server.yml"
+export APP_LOG_CONF_FILE="../profiles/dev/log.yml"
+
+go run server.go user.go
+```
+start http request
+```shell
+cd samples/dubbogo/simple/resolve/test
+
+go test  pixiu_test.go
+```
+
 ## Features
 
 - You can customize your own dubbo-go-pixiu with plugin.
diff --git a/README_CN.md b/README_CN.md
index b913f9e..a4cb3db 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -16,7 +16,7 @@ Dubbo-Go-Pixiu 网关支持调用Java的dubbo集群和golang的dubbo-go集群。
 #### 进入示例代码目录
 
 ```
-cd samples/dubbo/simple
+cd samples/dubbogo/simple
 ```
 
 可以使用 start.sh 脚本快速启动案例项目,可以执行如下命令来获得更多信息
@@ -54,7 +54,7 @@ cd samples/dubbo/simple
 可以使用下列命令来手动启动 pixiu
 
 ```
- go run cmd/pixiu/*.go gateway start -c /[absolute-path]/dubbo-go-pixiu/samples/dubbo/simple/body/pixiu/conf.yaml
+ go run cmd/pixiu/*.go gateway start -c /[absolute-path]/dubbo-go-pixiu/samples/dubbogo/simple/body/pixiu/conf.yaml
 ```
 
 
@@ -73,6 +73,36 @@ curl -X POST 'localhost:8881/api/v1/test-dubbo/user' -d '{"id":"0003","code":3,"
 ./start.sh clean body
 ```
 
+
+## docker启动示例
+
+#### 
+```shell
+docker pull phial3/dubbo-go-pixiu:latest
+```
+```
+docker run --name pixiuname -p 8883:8883 \
+    -v /yourpath/conf.yaml:/etc/pixiu/conf.yaml \
+    -v /yourpath/log.yml:/etc/pixiu/log.yml \
+    apache/dubbo-go-pixiu:latest
+```
+#### http请求调用dubbo服务转换
+首先启动provider,这里使用zookeeper作为注册中心
+```shell
+cd samples/dubbogo/simple/resolve/server
+
+export DUBBO_GO_CONFIG_PATH="../profiles/dev/server.yml"
+export APP_LOG_CONF_FILE="../profiles/dev/log.yml"
+
+go run server.go user.go
+```
+进入到test目录下,启动test示例
+```shell
+cd samples/dubbogo/simple/resolve/test
+
+go test  pixiu_test.go
+```
+
 ## 特性
 
 - 多协议支持
diff --git a/samples/dubbogo/simple/resolve/server/app/server.go b/samples/dubbogo/simple/resolve/server/app/server.go
index 3217b2e..776280f 100644
--- a/samples/dubbogo/simple/resolve/server/app/server.go
+++ b/samples/dubbogo/simple/resolve/server/app/server.go
@@ -37,8 +37,8 @@ const Version = "2.7.5"
 var survivalTimeout = int(3e9)
 
 // they are necessary:
-// 		export CONF_PROVIDER_FILE_PATH="xxx"
-// 		export APP_LOG_CONF_FILE="xxx"
+// export DUBBO_GO_CONFIG_PATH="../profiles/dev/server.yml"
+// export APP_LOG_CONF_FILE="../profiles/dev/log.yml"
 func main() {
 	config.Load()
 	logger.Infof("dubbo version is: %s", Version)