forked from jlesage/docker-baseimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Combined Dockerfile.alpine and Dockerfile.alpine-glibc by conditionaly installing glibc. - Each different images that need to be built have their parameters set in separate files. - Use build args instead of generating a new Dockerfile. - Added script for local builds. - Pave the way for multi-arch images.
- Loading branch information
Showing
19 changed files
with
324 additions
and
266 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,2 +1,3 @@ | ||
# This is a dummy Dockerfile. Do not edit, it will be overwritten by Docker automated build. | ||
# To get the content of Dockerfile, see https://github.com/jlesage/docker-baseimage-gui | ||
# This is a dummy Dockerfile. | ||
# See https://github.com/jlesage/docker-baseimage to get the content of the | ||
# Dockerfile used to generate this image. |
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 was deleted.
Oops, something went wrong.
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,83 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
SCRIPT_DIR="$(readlink -f "$(dirname "$0")")" | ||
|
||
usage() { | ||
if [ "$*" ]; then | ||
echo "$*" | ||
echo | ||
fi | ||
|
||
echo "usage: $( basename $0 ) [OPTION]... DOCKER_TAG [DOCKER_TAG]... | ||
Arguments: | ||
DOCKER_TAG Defines the container flavor to build. Valid values are: | ||
$(find "$SCRIPT_DIR"/versions -type f -printf ' %f\n' | sort) | ||
all | ||
Options: | ||
-c, --without-cache Do not use the Docker cache when building. | ||
-h, --help Display this help. | ||
" | ||
} | ||
|
||
requirements() { | ||
if [ -z "$( which bats )" ]; then | ||
echo "ERROR: To run test, bats needs to be installed." | ||
fi | ||
} | ||
|
||
# Parse arguments. | ||
while [[ $# > 0 ]] | ||
do | ||
key="$1" | ||
|
||
case $key in | ||
-c|--without-cache) | ||
USE_DOCKER_BUILD_CACHE=0 | ||
;; | ||
-h|--help) | ||
usage | ||
exit 0 | ||
;; | ||
-*) | ||
usage "ERROR: Unknown argument: $key" | ||
exit 1 | ||
;; | ||
*) | ||
break | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
DOCKER_TAGS="$*" | ||
|
||
[ -z "$DOCKER_TAGS" ] && usage "ERROR: At least one Docker tag must be specified." && exit 1 | ||
[ "$DOCKER_TAGS" == "all" ] && DOCKER_TAGS="$(find "$SCRIPT_DIR"/versions -type f -printf '%f ' | sort)" | ||
for DOCKER_TAG in $DOCKER_TAGS; do | ||
if [ ! -f "$SCRIPT_DIR"/versions/"$DOCKER_TAG" ]; then | ||
usage "ERROR: Invalid docker tag: $DOCKER_TAG." | ||
exit 1 | ||
fi | ||
done | ||
|
||
for DOCKER_TAG in $DOCKER_TAGS; do | ||
# Export build variables. | ||
export DOCKER_REPO=jlesage/baseimage | ||
export DOCKER_TAG=$DOCKER_TAG | ||
export USE_DOCKER_BUILD_CACHE=${USE_DOCKER_BUILD_CACHE:-1} | ||
|
||
# Build. | ||
hooks/pre_build | ||
hooks/build | ||
|
||
# Run tests. | ||
for i in $(seq -s ' ' 1 5 | rev) | ||
do | ||
echo "Starting tests of Docker image $DOCKER_REPO:$DOCKER_TAG in $i..." | ||
sleep 1 | ||
done | ||
env DOCKER_IMAGE="$DOCKER_REPO:$DOCKER_TAG" bats tests | ||
done |
Oops, something went wrong.