This is an automated email from the ASF dual-hosted git repository. wenming pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix-docker.git
The following commit(s) were added to refs/heads/master by this push: new 0d7e79c fixed bad link of centos. (#39) 0d7e79c is described below commit 0d7e79cb5b3efb756546911c2f83c06bfd96fd7f Author: Wen Ming <moonbingb...@gmail.com> AuthorDate: Sun Mar 15 14:32:12 2020 +0800 fixed bad link of centos. (#39) --- README.md | 19 +++--- alpine/Dockerfile | 174 ++---------------------------------------------------- centos/Dockerfile | 7 ++- 3 files changed, 17 insertions(+), 183 deletions(-) diff --git a/README.md b/README.md index 1c267de..f361ec7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -## Docker distribution for APISIX +## Docker distribution for Apache APISIX -You can install multiple versions of APISIX through docker: +You can install multiple versions of Apache APISIX through docker: 1. install master branch version, which has latest code: ``` @@ -9,7 +9,7 @@ docker build -t apisix:master-alpine -f alpine/Dockerfile alpine 2. install release versions: ``` -docker build -t apisix:0.8-alpine --build-arg APISIX_VERSION=0.8 -f alpine/Dockerfile alpine +docker build -t apisix:1.1-alpine --build-arg APISIX_VERSION=1.1 -f alpine/Dockerfile alpine ``` ## Run etcd server @@ -27,18 +27,18 @@ docker run -it --name etcd-server \ > 1. windows OS use absolute paths to hang in the configuration file. > 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` -## Run APISIX server +## Run Apache APISIX server -You need etcd docker to work with APISIX. You can refer to [the docker-compose example](example/README.md). +You need etcd docker to work with Apache APISIX. You can refer to [the docker-compose example](example/README.md). Or you can run APISIX with Docker directly(Docker name is test-api-gateway): ``` docker run --name test-api-gateway \ --v `pwd`/example/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml \ +-v `pwd`/example/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml \ -v `pwd`/example/apisix_log:/usr/local/apisix/logs \ --p 8080:9080 \ +-p 8080:9080 \ -p 8083:9443 \ --d iresty/apisix +-d apache/apisix ``` > Note: @@ -47,6 +47,3 @@ docker run --name test-api-gateway \ > > 2. windows OS use absolute paths to hang in the configuration file and log > dir. > -> 3. if the official image pull timeout : `request canceled (Client.Timeout exceeded while awaiting headers)`, it is recommended to use AliYun primary container registry -> -> mirror `docker pull registry.cn-beijing.aliyuncs.com/tinywan/apisix:alpine ` diff --git a/alpine/Dockerfile b/alpine/Dockerfile index f20cd73..e548fbf 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -1,173 +1,8 @@ -FROM alpine:3.9 + FROM openresty/openresty:alpine-fat -ARG APISIX_VERSION=master +ARG APISIX_VERSION=1.1 LABEL apisix_version="${APISIX_VERSION}" -ARG RESTY_LUAROCKS_VERSION="3.2.1" - -ARG RESTY_VERSION="1.15.8.2" -ARG RESTY_OPENSSL_VERSION="1.1.1c" -ARG RESTY_PCRE_VERSION="8.43" -ARG RESTY_J="4" - -ARG RESTY_CONFIG_OPTIONS="\ - --with-compat \ - --with-file-aio \ - --with-http_addition_module \ - --with-http_auth_request_module \ - --with-http_dav_module \ - --with-http_flv_module \ - --with-http_geoip_module=dynamic \ - --with-http_gunzip_module \ - --with-http_gzip_static_module \ - --with-http_image_filter_module=dynamic \ - --with-http_mp4_module \ - --with-http_random_index_module \ - --with-http_realip_module \ - --with-http_secure_link_module \ - --with-http_slice_module \ - --with-http_ssl_module \ - --with-http_stub_status_module \ - --with-http_sub_module \ - --with-http_v2_module \ - --with-http_xslt_module=dynamic \ - --with-ipv6 \ - --with-mail \ - --with-mail_ssl_module \ - --with-md5-asm \ - --with-pcre-jit \ - --with-sha1-asm \ - --with-stream \ - --with-stream_ssl_module \ - --with-threads \ - " -ARG RESTY_LUAJIT_OPTIONS="--with-luajit-xcflags='-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT'" - -# These are not intended to be user-specified -ARG _RESTY_CONFIG_DEPS="--with-pcre \ - --with-cc-opt='-DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl/include' \ - --with-ld-opt='-L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl/lib -Wl,-rpath,/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl/lib' \ - " - -# Volume for temporary files -VOLUME ["/var/run/openresty"] - -# If you are not in Mainland China, you can comment the following line of code -RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories - -# for openresty -RUN apk add --no-cache --virtual .build-deps \ - build-base \ - coreutils \ - curl \ - gd-dev \ - geoip-dev \ - libxslt-dev \ - linux-headers \ - make \ - perl-dev \ - readline-dev \ - zlib-dev \ - ${RESTY_ADD_PACKAGE_BUILDDEPS} \ - && apk add --no-cache \ - gd \ - geoip \ - libgcc \ - libxslt \ - zlib \ - && cd /tmp \ - && curl -fSL https://www.openssl.org/source/openssl-${RESTY_OPENSSL_VERSION}.tar.gz -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ - && tar xzf openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ - && cd openssl-${RESTY_OPENSSL_VERSION} \ - && if [ $(echo ${RESTY_OPENSSL_VERSION} | cut -c 1-5) = "1.1.1" ] ; then \ - echo 'patching OpenSSL 1.1.1 for OpenResty' \ - && curl -s https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-1.1.1c-sess_set_get_cb_yield.patch | patch -p1 ; \ - fi \ - && if [ $(echo ${RESTY_OPENSSL_VERSION} | cut -c 1-5) = "1.1.0" ] ; then \ - echo 'patching OpenSSL 1.1.0 for OpenResty' \ - && curl -s https://raw.githubusercontent.com/openresty/openresty/ed328977028c3ec3033bc25873ee360056e247cd/patches/openssl-1.1.0j-parallel_build_fix.patch | patch -p1 \ - && curl -s https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-1.1.0d-sess_set_get_cb_yield.patch | patch -p1 ; \ - fi \ - && ./config \ - no-threads shared zlib -g \ - enable-ssl3 enable-ssl3-method \ - --prefix=/usr/local/openresty/openssl \ - --libdir=lib \ - -Wl,-rpath,/usr/local/openresty/openssl/lib \ - && make -j${RESTY_J} \ - && make -j${RESTY_J} install_sw \ - && cd /tmp \ - && curl -fSL https://ftp.pcre.org/pub/pcre/pcre-${RESTY_PCRE_VERSION}.tar.gz -o pcre-${RESTY_PCRE_VERSION}.tar.gz \ - && tar xzf pcre-${RESTY_PCRE_VERSION}.tar.gz \ - && cd /tmp/pcre-${RESTY_PCRE_VERSION} \ - && ./configure \ - --prefix=/usr/local/openresty/pcre \ - --disable-cpp \ - --enable-jit \ - --enable-utf \ - --enable-unicode-properties \ - && make -j${RESTY_J} \ - && make -j${RESTY_J} install \ - && cd /tmp \ - && curl -fSL https://github.com/openresty/openresty/releases/download/v${RESTY_VERSION}/openresty-${RESTY_VERSION}.tar.gz -o openresty-${RESTY_VERSION}.tar.gz \ - && tar xzf openresty-${RESTY_VERSION}.tar.gz \ - && cd /tmp/openresty-${RESTY_VERSION} \ - && eval ./configure -j${RESTY_J} ${_RESTY_CONFIG_DEPS} ${RESTY_CONFIG_OPTIONS} ${RESTY_LUAJIT_OPTIONS} \ - && make -j${RESTY_J} \ - && make -j${RESTY_J} install \ - && cd /tmp \ - && rm -rf \ - openssl-${RESTY_OPENSSL_VERSION}.tar.gz openssl-${RESTY_OPENSSL_VERSION} \ - pcre-${RESTY_PCRE_VERSION}.tar.gz pcre-${RESTY_PCRE_VERSION} \ - openresty-${RESTY_VERSION}.tar.gz openresty-${RESTY_VERSION} \ - && apk del .build-deps \ - && ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log \ - && ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log - -# Add additional binaries into PATH for convenience -ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin - -# for luarocks -RUN apk add --no-cache --virtual .build-deps \ - perl-dev \ - && apk add --no-cache \ - bash \ - build-base \ - curl \ - linux-headers \ - make \ - outils-md5 \ - perl \ - unzip \ - && cd /tmp \ - && curl -fSL https://luarocks.github.io/luarocks/releases/luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \ - && tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \ - && cd luarocks-${RESTY_LUAROCKS_VERSION} \ - && ./configure \ - --prefix=/usr/local/openresty/luajit \ - --with-lua=/usr/local/openresty/luajit \ - --lua-suffix=jit-2.1.0-beta3 \ - --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \ - && make build \ - && make install \ - && cd /tmp \ - && rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \ - && apk add --no-cache --virtual .gettext gettext \ - && mv /usr/bin/envsubst /tmp/ \ - && runDeps="$( \ - scanelf --needed --nobanner /tmp/envsubst \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk del .build-deps .gettext \ - && mv /tmp/envsubst /usr/local/bin/ - -ENV LUA_PATH="/usr/local/openresty/site/lualib/?.ljbc;/usr/local/openresty/site/lualib/?/init.ljbc;/usr/local/openresty/lualib/?.ljbc;/usr/local/openresty/lualib/?/init.ljbc;/usr/local/openresty/site/lualib/?.lua;/usr/local/openresty/site/lualib/?/init.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/ [...] -ENV LUA_CPATH="/usr/local/openresty/site/lualib/?.so;/usr/local/openresty/lualib/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so" - -# for APISIX RUN apk add --no-cache --virtual .builddeps \ automake \ autoconf \ @@ -175,10 +10,11 @@ RUN apk add --no-cache --virtual .builddeps \ pkgconfig \ cmake \ git \ - && luarocks install https://github.com/iresty/apisix/raw/master/rockspec/apisix-${APISIX_VERSION}-0.rockspec --tree=/usr/local/apisix/deps \ + && luarocks install https://github.com/apache/incubator-apisix/raw/master/rockspec/apisix-${APISIX_VERSION}-0.rockspec --tree=/usr/local/apisix/deps \ && cp /usr/local/apisix/deps/lib/luarocks/rocks-5.1/apisix/${APISIX_VERSION}-0/bin/apisix /usr/bin/ \ - && bin='#! /usr/local/openresty/luajit/bin/luajit' \ + && bin='#! /usr/local/openresty/luajit/bin/luajit\npackage.path = "/usr/local/apisix/lua/?.lua;" .. package.path' \ && sed -i "1s@.*@$bin@" /usr/bin/apisix \ + && mv /usr/local/apisix/deps/share/lua/5.1/apisix/lua /usr/local/apisix \ && apk del .builddeps WORKDIR /usr/local/apisix diff --git a/centos/Dockerfile b/centos/Dockerfile index 64e0165..af44dc7 100644 --- a/centos/Dockerfile +++ b/centos/Dockerfile @@ -1,13 +1,14 @@ FROM centos:7 -ARG APISIX_VERSION=0.8 +ARG APISIX_VERSION=1.1 LABEL apisix_version="${APISIX_VERSION}" RUN yum -y install yum-utils\ && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo \ && yum install -y openresty \ - && yum install -y https://github.com/iresty/apisix/releases/download/v$APISIX_VERSION/apisix-$APISIX_VERSION-0.el7.noarch.rpm \ - && yum clean all + && yum install -y https://github.com/apache/incubator-apisix/releases/download/$APISIX_VERSION/apisix-$APISIX_VERSION-0.el7.noarch.rpm \ + && yum clean all \ + && sed -i 's/PASS_MAX_DAYS\t99999/PASS_MAX_DAYS\t60/g' /etc/login.defs WORKDIR /usr/local/apisix