Dockerfile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. FROM debian:bullseye-slim
  18. ARG APISIX_VERSION=2.15.3
  19. RUN set -ex; \
  20. arch=$(dpkg --print-architecture); \
  21. apt update; \
  22. apt-get -y install --no-install-recommends gnupg ca-certificates curl; \
  23. codename=`grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release`; \
  24. curl -sSL https://openresty.org/package/pubkey.gpg | apt-key add -; \
  25. case "${arch}" in \
  26. amd64) \
  27. echo "deb http://openresty.org/package/debian $codename openresty" | tee /etc/apt/sources.list.d/openresty.list \
  28. && curl -sSL http://repos.apiseven.com/pubkey.gpg | apt-key add - \
  29. && echo "deb http://repos.apiseven.com/packages/debian $codename main" | tee /etc/apt/sources.list.d/apisix.list \
  30. ;; \
  31. arm64) \
  32. echo "deb http://openresty.org/package/arm64/debian $codename openresty" | tee /etc/apt/sources.list.d/openresty.list \
  33. && curl -sSL http://repos.apiseven.com/pubkey.gpg | apt-key add - \
  34. && echo "deb http://repos.apiseven.com/packages/arm64/debian $codename main" | tee /etc/apt/sources.list.d/apisix.list \
  35. ;; \
  36. esac; \
  37. apt update \
  38. && apt install -y apisix=${APISIX_VERSION}-0 \
  39. && apt-get purge -y --auto-remove \
  40. && rm -f /etc/apt/sources.list.d/openresty.list /etc/apt/sources.list.d/apisix.list \
  41. && openresty -V \
  42. && apisix version
  43. WORKDIR /usr/local/apisix
  44. # forward request and error logs to docker log collector
  45. RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
  46. && ln -sf /dev/stderr /usr/local/apisix/logs/error.log
  47. EXPOSE 9080 9443
  48. COPY ./docker-entrypoint.sh /docker-entrypoint.sh
  49. ENTRYPOINT ["/docker-entrypoint.sh"]
  50. CMD ["docker-start"]
  51. STOPSIGNAL SIGQUIT