Skip to content

Commit

Permalink
chore(kong-ee) migrate the private kong-ee repository to here (Kong#336)
Browse files Browse the repository at this point in the history
* feat(enterprise) merge our Kong enterprise dockerfiles into the public repository

* chore(ci) adjust the Dockerfile's so they can be scripted to update

* chore(ci) modified the update script for the new Dockerfile's

* feat(local) ability to build a Kong docker container using a local asset not from bintray

* chore(dependency) bump the ci tests we us

* chore(refactor) take a stab at moving the logic out of the Dockerfile into build scripts

* chore(refactor) move more logic out of the Dockerfile

* chore(refactor) move more logic out of the Dockerfile

* chore(*) bump to Kong 2.0.0

* fix(test) adjust how the test determines version we're trying to build

* fix(alpine) adjust alpine download location
  • Loading branch information
hutchic authored Feb 14, 2020
1 parent 84797ba commit d2d7074
Show file tree
Hide file tree
Showing 23 changed files with 564 additions and 139 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
matrix:
- BASE="centos" KONG_DOCKER_TAG="kong-centos"
- BASE="alpine" KONG_DOCKER_TAG="kong-alpine"
- BASE="ubuntu" KONG_DOCKER_TAG="kong-ubuntu"
- BASE="rhel" KONG_DOCKER_TAG="kong-rhel"

before_script:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KONG_BUILD_TOOLS?=3.0.1
KONG_BUILD_TOOLS?=3.1.0
BASE?=centos

build:
Expand Down
51 changes: 34 additions & 17 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
FROM ubuntu:bionic AS downloader

RUN apt-get update \
&& apt-get install -y curl

ARG BINTRAY_USER
ENV BINTRAY_USER $BINTRAY_USER

ARG BINTRAY_KEY
ENV BINTRAY_KEY $BINTRAY_KEY

ARG BUILD_SCRIPT=build-ce.sh
COPY $BUILD_SCRIPT /tmp/build.sh

ARG ASSET_LOCATION=bintray
ENV ASSET_LOCATION $ASSET_LOCATION

ARG LOCAL_KONG_PACKAGE=empty-kong.tar.gz
COPY $LOCAL_KONG_PACKAGE /tmp/kong.tar.gz

RUN if [ "$ASSET_LOCATION" = "local" ] ; then exit 0 ; fi; \
. /tmp/build.sh

RUN mkdir /kong; \
tar -C /kong -xzf /tmp/kong.tar.gz

FROM alpine:3.11
LABEL maintainer="Kong Core Team <team-core@konghq.com>"

ENV KONG_VERSION 2.0.1
ENV KONG_SHA256 170e3f230640cef9e307fd8411287b05a1ba9162b3fc1b53417f199869dcf065
LABEL maintainer="Kong <support@konghq.com>"

COPY --from=DOWNLOADER /kong/usr/local /usr/local
COPY --from=DOWNLOADER /kong/etc /etc

RUN adduser -S kong \
&& mkdir -p "/usr/local/kong" \
RUN apk add --no-cache libgcc openssl pcre perl tzdata libcap zip \
&& adduser -S kong \
&& mkdir -p "/usr/local/kong" \
&& chown -R kong:0 /usr/local/kong \
&& chmod -R g=u /usr/local/kong \
&& apk add --no-cache --virtual .build-deps curl wget tar ca-certificates \
&& apk add --no-cache libgcc openssl pcre perl tzdata libcap su-exec zip \
&& wget -O kong.tar.gz "https://bintray.com/kong/kong-alpine-tar/download_file?file_path=kong-$KONG_VERSION.amd64.apk.tar.gz" \
&& echo "$KONG_SHA256 *kong.tar.gz" | sha256sum -c - \
&& tar -xzf kong.tar.gz -C /tmp \
&& rm -f kong.tar.gz \
&& cp -R /tmp/usr / \
&& rm -rf /tmp/usr \
&& cp -R /tmp/etc / \
&& rm -rf /tmp/etc
&& chmod -R g=u /usr/local/kong

USER kong

Expand All @@ -30,4 +47,4 @@ EXPOSE 8000 8443 8001 8444

STOPSIGNAL SIGQUIT

CMD ["kong", "docker-start"]
CMD ["kong", "docker-start"]
3 changes: 3 additions & 0 deletions alpine/build-ce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VERSION=${VERSION:-2.0.1} && \
curl -L "https://bintray.com/kong/kong-alpine-tar/download_file?file_path=kong-$VERSION.amd64.apk.tar.gz" -o /tmp/kong.tar.gz
echo "170e3f230640cef9e307fd8411287b05a1ba9162b3fc1b53417f199869dcf065 /tmp/kong.tar.gz" | sha256sum -c -
2 changes: 2 additions & 0 deletions alpine/build-ee.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
curl -L -u$BINTRAY_USER:$BINTRAY_KEY https://kong.bintray.com/kong-enterprise-edition-alpine-tar/kong-enterprise-edition-1.3.0.1.apk.tar.gz -o /kong.tar.gz
echo "64a0ceabad26edfdab1173f3485859f14477485023ab6fdd2019fd6893c97bbb kong.tar.gz" | sha256sum -c -
Empty file added alpine/empty-kong.tar.gz
Empty file.
Loading

0 comments on commit d2d7074

Please sign in to comment.