-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker) separate out the ability to build a docker image (#16)
- Loading branch information
Showing
4 changed files
with
51 additions
and
34 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
RHEL=false | ||
if [ "$RESTY_IMAGE_BASE" == "alpine" ]; then | ||
DOCKER_FILE="Dockerfile.alpine" | ||
elif [ "$RESTY_IMAGE_BASE" == "ubuntu" ] || [ "$RESTY_IMAGE_BASE" == "debian" ]; then | ||
DOCKER_FILE="Dockerfile.deb" | ||
elif [ "$RESTY_IMAGE_BASE" == "centos" ]; then | ||
DOCKER_FILE="Dockerfile.rpm" | ||
cp output/${KONG_PACKAGE_NAME}-${KONG_VERSION}.el${RESTY_IMAGE_TAG}.noarch.rpm output/kong.rpm | ||
elif [ "$RESTY_IMAGE_BASE" == "amazonlinux" ]; then | ||
DOCKER_FILE="Dockerfile.rpm" | ||
cp output/${KONG_PACKAGE_NAME}-${KONG_VERSION}.aws.rpm output/kong.rpm | ||
elif [ "$RESTY_IMAGE_BASE" == "rhel" ]; then | ||
docker pull registry.access.redhat.com/rhel${RESTY_IMAGE_TAG} | ||
docker tag registry.access.redhat.com/rhel${RESTY_IMAGE_TAG} rhel:${RESTY_IMAGE_TAG} | ||
DOCKER_FILE="Dockerfile.rpm" | ||
RHEL=true | ||
else | ||
echo "Unrecognized base image $RESTY_IMAGE_BASE" | ||
exit 1 | ||
fi | ||
|
||
docker build \ | ||
--build-arg RESTY_IMAGE_BASE=$RESTY_IMAGE_BASE \ | ||
--build-arg RESTY_IMAGE_TAG=$RESTY_IMAGE_TAG \ | ||
--build-arg KONG_VERSION=$KONG_VERSION \ | ||
--build-arg KONG_PACKAGE_NAME=$KONG_PACKAGE_NAME \ | ||
--build-arg RHEL=$RHEL \ | ||
--build-arg REDHAT_USERNAME=$REDHAT_USERNAME \ | ||
--build-arg REDHAT_PASSWORD=$REDHAT_PASSWORD \ | ||
-f test/$DOCKER_FILE \ | ||
-t $KONG_TEST_CONTAINER_NAME . |
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