1.docker安装etcd
docker run -it -p 2379:2379 --env ALLOW_NONE_AUTHENTICATION=yes -d bitnami/etcd
2.安装apisix
docker run -v /config.yaml:/usr/local/apisix/conf/config.yaml -p 9080:9080 -d apache/apisix
修改配置文件对应的ip

遇到ip adress not allowed的问题
解决:修改allow_list对应本机网关
通过源码编译镜像
1.编译apisix需要安装luarocks依赖
$wget http://luarocks.org/releases/luarocks-3.7.0.tar.gz
2.解压缩tar -xzvf luarocks-3.7.0.tar.gz
3.cd luarocks-3.7.0/
4…/configure --prefix=/usr/local/openresty/luajit \ 安装到此目录下
–with-lua=/usr/local/openresty/luajit/
–lua-suffix=jit
–with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
lua
安装路径下的
lua.h
的位置,即
find / -name "lua.h"
,我的路径是
usr/local/lua/src/lua.h
在
usr/local/luarocks
下执行
./configure --prefix=/usr/local/luarocks --with-lua-include=/usr/local/lua/src
其中,
predix
是指定LuaRocks 安装路径,
with-lua-include
指定lua文件位置,默认为
$LUA_DIR/include
5. make build
6. sudo make install
7. vi ~/.bash_profile
8. export PATH=$PATH:/usr/local/openresty/luajit/bin 将此项添加进去
9. source /etc/profile
10. reboot
11.luarocks查看是否安装成功