基于Apisix-base 构建Apisix docker 镜像

# Build Apache APISIX
FROM api7/apisix-base:1.19.9.1.5

ARG APISIX_VERSION=2.13.1
LABEL apisix_version="${APISIX_VERSION}"
ARG APISIX_PLUGIN_RUNNER_VERSION=0.2.0
ENV TZ=Asia/Shanghai

RUN set -x \
    && (/bin/sed -i 's,https://dl-cdn.alpinelinux.org,https://mirrors.aliyun.com,g' /etc/apk/repositories) \
    && apk add --no-cache --virtual .builddeps \
        build-base \
        automake \
        autoconf \
        make \
        libtool \
        pkgconfig \
        cmake \
        unzip \
        curl \
        openssl \
    && apk del .builddeps \
    && apk add --no-cache \
        bash \
        curl \
        libstdc++ \
        tzdata \
        nss

WORKDIR /usr/local/apisix

COPY --from=apache/apisix:2.13.1-alpine /usr/local/apisix /usr/local/apisix
COPY --from=apache/apisix:2.13.1-alpine /usr/bin/apisix /usr/bin/apisix
COPY --from=apache/apisix:2.13.1-alpine /usr/local/openresty/ /usr/local/openresty/

RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
    && ln -sf /dev/stderr /usr/local/apisix/logs/error.log

ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin

## 阶段二,拷贝插件
ADD dist/apache-apisix-java-plugin-runner-${APISIX_PLUGIN_RUNNER_VERSION}-bin.tar.gz /usr/local/apisix/java-plugins/

## 阶段三,构建jdk 环境
COPY --from=openjdk:8-alpine /usr/lib/jvm/java-1.8-openjdk /usr/local/
RUN ln -s /usr/lib/jvm/java-1.8-openjdk/bin/java /usr/bin/

EXPOSE 9080 9443 9180 10005

CMD ["sh", "-c", "/usr/bin/apisix init && /usr/bin/apisix init_etcd && /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'"]

STOPSIGNAL SIGQUIT

你可能感兴趣的:(Linux,工具及软件安装,docker,java,apache)