Skip to content

Commit

Permalink
fix(docker-kong) adjust Kong-build-tools to be compatible with docker…
Browse files Browse the repository at this point in the history
…-kong compatibility (#270)

* chore(docker-kong) adjust Kong-build-tools to be compatible with docker-kong

* chore(docker-kong) redhat compatibility
  • Loading branch information
hutchic committed May 6, 2020
2 parents c475422 + 9c6c792 commit 1b782c5
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,29 @@ rm -rf docker-kong || true
git clone --single-branch --branch $DOCKER_KONG_VERSION https://github.com/Kong/docker-kong.git docker-kong

if [ "$RESTY_IMAGE_BASE" == "ubuntu" ] || [ "$RESTY_IMAGE_BASE" == "debian" ]; then
cp output/*${RESTY_IMAGE_TAG}.amd64.deb docker-kong/ubuntu/kong
cp output/*${RESTY_IMAGE_TAG}.amd64.deb docker-kong/ubuntu/empty-kong.deb
BUILD_DIR="ubuntu"
elif [ "$RESTY_IMAGE_BASE" == "alpine" ]; then
cp output/*.amd64.apk.tar.gz docker-kong/alpine/kong
cp output/*.amd64.apk.tar.gz docker-kong/alpine/empty-kong.tar.gz
BUILD_DIR="alpine"
elif [ "$RESTY_IMAGE_BASE" == "centos" ] || [ "$RESTY_IMAGE_BASE" == "amazonlinux" ]; then
cp output/*.amd64.rpm docker-kong/centos/kong
cp output/*.amd64.rpm docker-kong/centos/empty-kong.rpm
BUILD_DIR="centos"
elif [ "$RESTY_IMAGE_BASE" == "rhel" ]; then
cp output/*.rhel${RESTY_IMAGE_TAG}.amd64.rpm docker-kong/rhel/kong
fi

if [ "$RESTY_IMAGE_BASE" == "rhel" ]; then
sed -i 's/^FROM .*/FROM registry.access.redhat.com\/ubi'${RESTY_IMAGE_TAG}'\/ubi/' docker-kong/rhel/Dockerfile
sed -i 's/rhel7/rhel'${RESTY_IMAGE_TAG}'/' docker-kong/rhel/Dockerfile
cp output/*.rhel${RESTY_IMAGE_TAG}.amd64.rpm docker-kong/rhel/empty-kong.rpm
BUILD_DIR="rhel"
else
exit 1
sed -i 's/^FROM .*/FROM '${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}'/' docker-kong/${BUILD_DIR}/Dockerfile
fi

pushd docker-kong/${BUILD_DIR}
docker build -t $KONG_TEST_IMAGE_NAME \
--no-cache \
--build-arg LOCAL_KONG_PACKAGE=kong \
--build-arg RESTY_IMAGE_BASE=$RESTY_IMAGE_BASE \
--build-arg RESTY_IMAGE_TAG=$RESTY_IMAGE_TAG \
--build-arg ASSET_LOCATION=local .
--build-arg ASSET=local .
popd

rm -rf docker-kong || true

0 comments on commit 1b782c5

Please sign in to comment.