-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cache) aggressively cache the kong development / test image (#247)
* feat(cache) aggressively cache the kong development / test image * chore(squash) TIL docker build --squash * Revert "chore(squash) TIL docker build --squash" This reverts commit 3c6aa17.
- Loading branch information
Showing
3 changed files
with
61 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,47 @@ | ||
ARG RESTY_IMAGE_BASE="ubuntu" | ||
ARG RESTY_IMAGE_TAG="bionic" | ||
ARG DOCKER_KONG_SUFFIX | ||
ARG DOCKER_BASE_SUFFIX | ||
ARG KONG_SHA | ||
ARG DOCKER_REPOSITORY | ||
|
||
FROM ${DOCKER_REPOSITORY}:kong-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}-${DOCKER_KONG_SUFFIX} as KONG | ||
|
||
FROM ${DOCKER_REPOSITORY}:${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}-${DOCKER_BASE_SUFFIX} | ||
|
||
ENV PATH=$PATH:/kong/bin:/usr/local/openresty/bin/:/usr/local/kong/bin/:/usr/local/openresty/nginx/sbin/ | ||
ENV LUA_PATH=/kong/?.lua;/kong/?/init.lua;/root/.luarocks/share/lua/5.1/?.lua;/root/.luarocks/share/lua/5.1/?/init.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua | ||
ENV LUA_CPATH=/root/.luarocks/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/?.so;./?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so | ||
|
||
COPY --from=KONG /tmp/build/ /tmp/build | ||
RUN cp -R /tmp/build/* / | ||
RUN rm -rf /usr/local/bin/kong | ||
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ | ||
apt-get update && apt-get install -y \ | ||
tzdata \ | ||
vim \ | ||
jq \ | ||
httpie \ | ||
iputils-ping \ | ||
net-tools \ | ||
valgrind \ | ||
net-tools && \ | ||
dpkg-reconfigure --frontend noninteractive tzdata && \ | ||
apt-get install -y postgresql | ||
|
||
COPY --from=KONG /usr/local/go /usr/local/go | ||
|
||
ENV KONG_GO_PLUGINSERVER_VERSION=master | ||
ENV GOPATH=/tmp/go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
|
||
RUN mkdir -p /tmp/go/src/github.com/kong/ \ | ||
&& git clone --branch ${KONG_GO_PLUGINSERVER_VERSION} https://github.com/Kong/go-pluginserver.git /tmp/go/src/github.com/kong/go-pluginserver \ | ||
&& cd /tmp/go/src/github.com/kong/go-pluginserver \ | ||
&& go mod tidy | ||
|
||
|
||
COPY kong /kong | ||
RUN mkdir -p /kong/servroot/logs | ||
RUN chmod -R 777 /kong | ||
WORKDIR /kong | ||
RUN make dev | ||
|
||
RUN curl -L https://cpanmin.us | perl - App::cpanminus \ | ||
&& cpanm --notest Test::Nginx \ | ||
&& cpanm --notest local::lib | ||
|
||
RUN rm -rf /tmp/build | ||
|
||
CMD ["sh", "-c", "cat /kong/spec/fixtures/hosts >> /etc/hosts; tail -f /dev/null"] | ||
ARG DOCKER_OPENRESTY_SUFFIX | ||
ARG DOCKER_REPOSITORY | ||
|
||
FROM ${DOCKER_REPOSITORY}:test-${DOCKER_OPENRESTY_SUFFIX} | ||
|
||
ENV PATH=$PATH:/kong/bin:/usr/local/openresty/bin/:/usr/local/kong/bin/:/usr/local/openresty/nginx/sbin/ | ||
ENV LUA_PATH=/kong/?.lua;/kong/?/init.lua;/root/.luarocks/share/lua/5.1/?.lua;/root/.luarocks/share/lua/5.1/?/init.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua | ||
ENV LUA_CPATH=/root/.luarocks/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/?.so;./?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so | ||
|
||
RUN cp -R /tmp/build/* / || true | ||
RUN rm -rf /usr/local/bin/kong | ||
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ | ||
apt-get update && apt-get install -y \ | ||
tzdata \ | ||
vim \ | ||
jq \ | ||
httpie \ | ||
iputils-ping \ | ||
net-tools \ | ||
valgrind \ | ||
net-tools && \ | ||
dpkg-reconfigure --frontend noninteractive tzdata && \ | ||
apt-get install -y postgresql | ||
|
||
ENV KONG_GO_PLUGINSERVER_VERSION=master | ||
ENV GOPATH=/tmp/go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
|
||
RUN rm -rf /tmp/go/src/github.com/kong/ \ | ||
&& mkdir -p /tmp/go/src/github.com/kong/ \ | ||
&& git clone --branch ${KONG_GO_PLUGINSERVER_VERSION} https://github.com/Kong/go-pluginserver.git /tmp/go/src/github.com/kong/go-pluginserver \ | ||
&& cd /tmp/go/src/github.com/kong/go-pluginserver \ | ||
&& go mod tidy | ||
|
||
COPY kong /kong | ||
RUN mkdir -p /kong/servroot/logs | ||
RUN chmod -R 777 /kong | ||
WORKDIR /kong | ||
RUN make dev | ||
|
||
RUN curl -L https://cpanmin.us | perl - App::cpanminus \ | ||
&& cpanm --notest Test::Nginx \ | ||
&& cpanm --notest local::lib | ||
|
||
RUN rm -rf /tmp/build | ||
|
||
CMD ["sh", "-c", "cat /kong/spec/fixtures/hosts >> /etc/hosts; tail -f /dev/null"] |