Dockerfile 854 B

12345678910111213141516171819202122
  1. FROM centos:7
  2. ARG APISIX_VERSION=2.10.1
  3. LABEL apisix_version="${APISIX_VERSION}"
  4. RUN yum -y install yum-utils\
  5. && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo \
  6. && yum install -y pcre openresty which tzdata openldap-devel \
  7. && yum install -y https://github.com/apache/apisix/releases/download/$APISIX_VERSION/apisix-$APISIX_VERSION-0.el7.x86_64.rpm \
  8. && yum clean all \
  9. && sed -i 's/PASS_MAX_DAYS\t99999/PASS_MAX_DAYS\t60/g' /etc/login.defs
  10. WORKDIR /usr/local/apisix
  11. # forward request and error logs to docker log collector
  12. RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
  13. && ln -sf /dev/stderr /usr/local/apisix/logs/error.log
  14. EXPOSE 9080 9443
  15. CMD ["sh", "-c", "/usr/bin/apisix init && /usr/bin/apisix init_etcd && /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'"]