This is an automated email from the ASF dual-hosted git repository.
moonming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 03dcc73367 docs: fix grpc-transcode Docker example networking (#14048)
03dcc73367 is described below
commit 03dcc733671b0b1fd0c9f2ded567cbbb029b97d6
Author: Traky Deng <[email protected]>
AuthorDate: Tue Nov 10 14:26:10 2026 +0800
docs: fix grpc-transcode Docker example networking (#14048)
---
docs/en/latest/plugins/grpc-transcode.md | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/docs/en/latest/plugins/grpc-transcode.md
b/docs/en/latest/plugins/grpc-transcode.md
index 4b756d363b..baebdb6096 100644
--- a/docs/en/latest/plugins/grpc-transcode.md
+++ b/docs/en/latest/plugins/grpc-transcode.md
@@ -74,18 +74,21 @@ admin_key=$(yq '.deployment.admin.admin_key[0].key'
conf/config.yaml | sed 's/"/
:::
-To follow along the examples, start an [example gRPC
server](https://github.com/api7/grpc_server_example):
+The examples assume APISIX is running in the `apisix-quickstart-net` Docker
network created by the quickstart script. Start the [example gRPC
server](https://github.com/api7/grpc_server_example) in that network. The image
digest pins the tested contents of tag `1.0.2`:
```shell
-docker run -d \
- --name grpc-example-server \
+docker rm -f quickstart-grpc-example 2>/dev/null || true
+
+docker run -d --rm \
+ --name quickstart-grpc-example \
+ --network apisix-quickstart-net \
-p 50051:50051 \
- api7/grpc-server-example:1.0.2
+
api7/grpc-server-example:1.0.2@sha256:9d822f5957724d2b9f668e81d5cd221e030a7155ac5558b56f1a07cb9e8cbbce
```
-### Transform between HTTP and gRPC Requests
+### Transform Between HTTP and gRPC Requests
-The following example demonstrates how to configure protobuf in APISIX and
transform between HTTP and gRPC requests using the `grpc-transcode` Plugin.
+This example stores a Protocol Buffer definition in APISIX and uses it to
transform HTTP requests and gRPC responses with the `grpc-transcode` Plugin.
Create a proto resource to store the protobuf:
@@ -121,7 +124,7 @@ curl
"http://127.0.0.1:9180/apisix/admin/routes/grpc-transcode-route" -H "X-API-
"scheme": "grpc",
"type": "roundrobin",
"nodes": {
- "127.0.0.1:50051": 1
+ "quickstart-grpc-example:50051": 1
}
}
}'
@@ -172,7 +175,7 @@ Convert the `.pb` file from binary to base64 and configure
it in APISIX:
```shell
curl "http://127.0.0.1:9180/apisix/admin/protos/echo-proto" -H "X-API-KEY:
$admin_key" -X PUT -d '
{
- "content" : "'"$(base64 -w0 /path/to/echo_proto.pb)"'"
+ "content" : "'"$(base64 < /path/to/echo_proto.pb | tr -d '\r\n')"'"
}'
```
@@ -194,7 +197,7 @@ curl
"http://127.0.0.1:9180/apisix/admin/routes/grpc-transcode-route" -H "X-API-
"scheme": "grpc",
"type": "roundrobin",
"nodes": {
- "127.0.0.1:50051": 1
+ "quickstart-grpc-example:50051": 1
}
}
}'
@@ -255,7 +258,7 @@ curl
"http://127.0.0.1:9180/apisix/admin/routes/grpc-transcode-route" -H "X-API-
"scheme": "grpc",
"type": "roundrobin",
"nodes": {
- "127.0.0.1:50051": 1
+ "quickstart-grpc-example:50051": 1
}
}
}'
@@ -330,7 +333,7 @@ curl
"http://127.0.0.1:9180/apisix/admin/routes/grpc-transcode-route" -H "X-API-
"scheme": "grpc",
"type": "roundrobin",
"nodes": {
- "127.0.0.1:50051": 1
+ "quickstart-grpc-example:50051": 1
}
}
}'
@@ -399,7 +402,7 @@ curl
"http://127.0.0.1:9180/apisix/admin/routes/grpc-transcode-route" -H "X-API-
"scheme": "grpc",
"type": "roundrobin",
"nodes": {
- "127.0.0.1:50051": 1
+ "quickstart-grpc-example:50051": 1
}
}
}'
@@ -435,7 +438,7 @@ curl
"http://127.0.0.1:9180/apisix/admin/routes/grpc-transcode-route" -H "X-API-
"scheme": "grpc",
"type": "roundrobin",
"nodes": {
- "127.0.0.1:50051": 1
+ "quickstart-grpc-example:50051": 1
}
}
}'