Skip to content

Commit fd2deb9

Browse files
authored
doc: how to install APISIX more easily. (#63)
2 parents f3db8c3 + 0279e31 commit fd2deb9

File tree

3 files changed

+101
-83
lines changed

3 files changed

+101
-83
lines changed

README.md

Lines changed: 9 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,20 @@
1-
## Docker distribution for Apache APISIX
2-
31
**Docker images are not official ASF releases but provided for convenience. Recommended usage is always to build the source.**
42

5-
1. install release version (Apache releases are beginning from version 0.9):
6-
```
7-
# Assign Apache release version number to variable `APISIX_VERSION`, for example: 1.2 . The latest version can be find at `https://github.com/apache/incubator-apisix/releases`
8-
9-
APISIX_VERSION=1.2
10-
docker build -t apisix:${APISIX_VERSION}-alpine --build-arg APISIX_VERSION=${APISIX_VERSION} -f alpine/Dockerfile alpine
11-
```
12-
13-
2. install master branch version, which has latest code(ONLY for the developer's convenience):
14-
```
15-
docker build -t apisix:master-alpine -f alpine/Dockerfile alpine
16-
```
17-
18-
19-
## Run with docker
20-
21-
### Create a network `apisix`
22-
23-
```
24-
docker network create \
25-
--driver=bridge \
26-
--subnet=172.18.0.0/16 \
27-
--ip-range=172.18.5.0/24 \
28-
--gateway=172.18.5.254 \
29-
apisix
30-
```
31-
32-
### Run etcd server with `apisix` network
3+
## QuickStart
334

34-
35-
Specify ip `172.18.5.10`
36-
37-
```
38-
docker run -it --name etcd-server \
39-
-v `pwd`/example/etcd_conf/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml \
40-
-p 2379:2379 \
41-
-p 2380:2380 \
42-
--network apisix \
43-
--ip 172.18.5.10 \
44-
--env ALLOW_NONE_AUTHENTICATION=yes bitnami/etcd:3.3.13-r80
45-
```
46-
47-
> Note:
48-
>
49-
> 1. windows OS use absolute paths to hang in the configuration file.
50-
> 2. e.g:windows dir path `E:\GitHub\docker-apisix `,configuration file hang path is `-v /e/github/docker-apisix/example/etcd_conf/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml`
51-
52-
### Run Apache APISIX server
53-
54-
You need etcd docker to work with Apache APISIX. You can refer to [the docker-compose example](example/README.md).
55-
56-
Or you can run APISIX with Docker directly(Docker name is test-api-gateway):
57-
58-
Check or Modify etcd address to `http: //172.18.5.10:2379` in `pwd` / example / apisix_conf / config.yaml: /usr/local/apisix/conf/config.yaml
5+
**start all modules with docker-compose**
596

607
```
61-
docker run --name test-api-gateway \
62-
-v `pwd`/example/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml \
63-
-v `pwd`/example/apisix_log:/usr/local/apisix/logs \
64-
-p 9080:9080 \
65-
-p 9443:9443 \
66-
--network apisix \
67-
--ip 172.18.5.11 \
68-
-d apache/apisix
8+
$ cd example
9+
$ docker-compose -p docker-apisix up -d
6910
```
7011

71-
> Note:
72-
>
73-
> 1. windows OS use absolute paths to hang in the configuration file and log dir.
74-
>
12+
You can refer to [the docker-compose example](example/README.md) for more try.
7513

14+
## How To Build Image
7615

77-
### Have a test
16+
[Build your own image](build.md)
7817

79-
Test with admin api
18+
## Manual deploy apisix via docker
8019

81-
e.g. Get route list, should be return
82-
83-
```
84-
curl http://127.0.0.1:9080/apisix/admin/routes/
85-
...
86-
{"node":{"createdIndex":4,"modifiedIndex":4,"key":"\/apisix\/routes","dir":true},"action":"get"}
87-
```
88-
89-
### Clean
90-
```
91-
docker rm test-api-gateway
92-
docker rm etcd-server
93-
docker network rm apisix
94-
```
20+
[Manual deploy](manual.md)

build.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Build an image from source
2+
3+
**Docker images are not official ASF releases but provided for convenience. Recommended usage is always to build the source.**
4+
5+
1. install release version (Apache releases are beginning from version 0.9):
6+
```
7+
# Assign Apache release version number to variable `APISIX_VERSION`, for example: 1.2 . The latest version can be find at `https://github.com/apache/incubator-apisix/releases`
8+
9+
APISIX_VERSION=1.2
10+
docker build -t apisix:${APISIX_VERSION}-alpine --build-arg APISIX_VERSION=${APISIX_VERSION} -f alpine/Dockerfile alpine
11+
```
12+
13+
2. install master branch version, which has latest code(ONLY for the developer's convenience):
14+
```
15+
docker build -t apisix:master-alpine -f alpine/Dockerfile alpine
16+
```

manual.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
## Manual deploy apisix via docker
2+
3+
### Create a network `apisix`
4+
5+
```
6+
docker network create \
7+
--driver=bridge \
8+
--subnet=172.18.0.0/16 \
9+
--ip-range=172.18.5.0/24 \
10+
--gateway=172.18.5.254 \
11+
apisix
12+
```
13+
14+
### Run etcd server with `apisix` network
15+
16+
17+
Specify ip `172.18.5.10`
18+
19+
```
20+
docker run -it --name etcd-server \
21+
-v `pwd`/example/etcd_conf/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml \
22+
-p 2379:2379 \
23+
-p 2380:2380 \
24+
--network apisix \
25+
--ip 172.18.5.10 \
26+
--env ALLOW_NONE_AUTHENTICATION=yes bitnami/etcd:3.3.13-r80
27+
```
28+
29+
> Note:
30+
>
31+
> 1. windows OS use absolute paths to hang in the configuration file.
32+
> 2. e.g:windows dir path `E:\GitHub\docker-apisix `,configuration file hang path is `-v /e/github/docker-apisix/example/etcd_conf/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml`
33+
34+
### Run Apache APISIX server
35+
36+
You need etcd docker to work with Apache APISIX. You can refer to [the docker-compose example](example/README.md).
37+
38+
Or you can run APISIX with Docker directly(Docker name is test-api-gateway):
39+
40+
Check or Modify etcd address to `http: //172.18.5.10:2379` in `pwd` / example / apisix_conf / config.yaml: /usr/local/apisix/conf/config.yaml
41+
42+
```
43+
docker run --name test-api-gateway \
44+
-v `pwd`/example/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml \
45+
-v `pwd`/example/apisix_log:/usr/local/apisix/logs \
46+
-p 9080:9080 \
47+
-p 9443:9443 \
48+
--network apisix \
49+
--ip 172.18.5.11 \
50+
-d apache/apisix
51+
```
52+
53+
> Note:
54+
>
55+
> 1. windows OS use absolute paths to hang in the configuration file and log dir.
56+
>
57+
58+
59+
### Have a test
60+
61+
Test with admin api
62+
63+
e.g. Get route list, should be return
64+
65+
```
66+
curl http://127.0.0.1:9080/apisix/admin/routes/
67+
...
68+
{"node":{"createdIndex":4,"modifiedIndex":4,"key":"\/apisix\/routes","dir":true},"action":"get"}
69+
```
70+
71+
### Clean
72+
```
73+
docker rm test-api-gateway
74+
docker rm etcd-server
75+
docker network rm apisix
76+
```

0 commit comments

Comments
 (0)