|
1 | | -## Docker distribution for Apache APISIX |
2 | | - |
3 | 1 | **Docker images are not official ASF releases but provided for convenience. Recommended usage is always to build the source.** |
4 | 2 |
|
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 |
33 | 4 |
|
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** |
59 | 6 |
|
60 | 7 | ``` |
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 |
69 | 10 | ``` |
70 | 11 |
|
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. |
75 | 13 |
|
| 14 | +## How To Build Image |
76 | 15 |
|
77 | | -### Have a test |
| 16 | +[Build your own image](build.md) |
78 | 17 |
|
79 | | -Test with admin api |
| 18 | +## Manual deploy apisix via docker |
80 | 19 |
|
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) |
0 commit comments