Skip to content

Commit 6517eb2

Browse files
authored
feat(dockerfile): use apisix-start.sh as the entrypoint (#123)
1 parent 8e9f48c commit 6517eb2

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN yum clean packages
1010
# you can add more tools for debug
1111
# alreay on image: ifconfig nslookup dig ip ss route
1212
# install openresty & apisix
13-
RUN yum install -y apisix-${APISIX_VERSION} && \
13+
RUN yum install -y apisix-${APISIX_VERSION} && \
1414
yum install -y tar m4 findutils procps less iproute traceroute telnet lsof net-tools tcpdump mtr vim bind-utils libyaml-devel hostname gawk iputils python3 python3-pip sudo && \
1515
yum install -y wget unzip patch make
1616

@@ -41,6 +41,6 @@ RUN chmod 755 /data/bkgateway/bin/* && chmod 777 /usr/local/apisix/logs
4141
# 6. clean up
4242
RUN yum remove -y wget unzip patch make && yum clean all && rm -rf /var/cache/yum
4343

44-
CMD ["sh", "-c", "/usr/bin/apisix init && /usr/bin/apisix init_etcd && /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'"]
44+
ENTRYPOINT ["/data/bkgateway/bin/apisix-start.sh"]
4545

4646
STOPSIGNAL SIGQUIT

src/build/bin/apisix-start.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/sh
2+
3+
set -eo pipefail
4+
25
echo "starting......"
36

47
# start nginx error to sentry
@@ -12,7 +15,16 @@ then
1215
fi
1316

1417

15-
echo "start apisix"
16-
/usr/bin/apisix init && /usr/bin/apisix init_etcd && /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'
18+
echo "init apisix......"
19+
/usr/bin/apisix init
20+
21+
echo "init etcd......"
22+
/usr/bin/apisix init_etcd
23+
24+
25+
echo "start apisix......"
26+
exec /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'
27+
28+
echo "apisix quited"
1729

18-
echo "quit"
30+
sleep 2

0 commit comments

Comments
 (0)