membphis commented on code in PR #10899: URL: https://github.com/apache/apisix/pull/10899#discussion_r1477632249
########## docs/zh/latest/build-apisix-dev-environment-in-docker.md: ########## @@ -0,0 +1,96 @@ +--- +id: build-apisix-dev-environment-in-docker +title: 通过 Docker 构建开发环境 +description: 本文介绍了如何用 Docker 的方式快速构建 API 网关 Apache APISIX 开发环境。 +--- + +<!-- +# +# 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. +# +--> + +如果你希望快速的在你的系统上构建和开发 APISIX,你可以参考本教程。 + +:::note + +本教程适合需要快速开始入门阶段开发的情况,如果你想要更进一步,有更好的开发体验,更好的选择是 Linux-based 虚拟机,或是直接使用这类系统作为你的开发环境。 + +你可以在[这里](install-dependencies.md#安装)看到具体支持的系统。 + +::: + +## 快速搭建 Apache APISIX 开发环境 + +### 实现思路 + + + +### 实现步骤 + +首先,我们需要拉取 APISIX 源码,并构建一个可以运行测试用例以及编译运行 Apache APISIX 的镜像: + +```shell +git clone https://github.com/apache/apisix.git +cd apisix +docker build -t apisix-dev-env -f example/build-dev-image.dockerfile . +``` + +然后,我们要启动 Etcd: + +```shell +docker run -d --name etcd-apisix --net=host pachyderm/etcd:v3.5.2 +``` + +挂载 APISIX 目录并启动开发环境容器: + +```shell +docker run -d --name apisix-dev-env --net=host -v $(pwd):/apisix:rw apisix-dev-env:latest +``` + +最后,进入容器,构建 Apache APISIX 运行时并配置测试环境: + +```shell +docker exec -it apisix-dev-env /bin/bash + +make deps +ln -s /usr/bin/openresty /usr/bin/nginx +``` + +### 启动和停止 APISIX + +```shell +make run Review Comment: we'd better call them, in this way `docker exec ... ...` ########## docs/assets/images/develop-apisix-dev.png: ########## Review Comment: remove this images, change it to text ########## example/build-dev-image.dockerfile: ########## @@ -0,0 +1,31 @@ +# +# 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. +# + +FROM ubuntu + +# Install Test::Nginx +RUN apt update +RUN apt install -y cpanminus make +RUN cpanm --notest Test::Nginx + +RUN apt install -y sudo git gawk curl Review Comment: add `vim` ########## docs/zh/latest/build-apisix-dev-environment-in-docker.md: ########## @@ -0,0 +1,96 @@ +--- +id: build-apisix-dev-environment-in-docker +title: 通过 Docker 构建开发环境 +description: 本文介绍了如何用 Docker 的方式快速构建 API 网关 Apache APISIX 开发环境。 +--- + +<!-- +# +# 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. +# +--> + +如果你希望快速的在你的系统上构建和开发 APISIX,你可以参考本教程。 Review Comment: mainly for Mac Os users, not others -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
