diff --git a/hooks/build b/hooks/build new file mode 100644 index 0000000..38f890d --- /dev/null +++ b/hooks/build @@ -0,0 +1,13 @@ +#!/bin/bash + +# original docker build command +echo "overwriting docker build -f $DOCKERFILE_PATH -t $IMAGE_NAME ." + +cat "../versions.txt" | while read VERSION +do + # The new image tag will include the version of ubuntu + IMAGE_TAG="${DOCKER_REPO}:${VERSION}" + + echo "docker build -f Dockerfile --build-arg VERSION=${VERSION} -t ${IMAGE_TAG} ." + docker build -f Dockerfile --build-arg VERSION=${VERSION} -t ${IMAGE_TAG} . +done diff --git a/hooks/push b/hooks/push new file mode 100644 index 0000000..71bcdd9 --- /dev/null +++ b/hooks/push @@ -0,0 +1,13 @@ +#!/bin/bash + +# original docker push command +echo "overwriting docker push $IMAGE_NAME" + +cat "../versions.txt" | while read VERSION +do + # The new image tag will include the version of ubuntu + IMAGE_TAG="${DOCKER_REPO}:${VERSION}" + + echo "docker push ${IMAGE_TAG}" + docker push ${IMAGE_TAG} +done \ No newline at end of file diff --git a/versions.txt b/versions.txt new file mode 100644 index 0000000..3eb6ac4 --- /dev/null +++ b/versions.txt @@ -0,0 +1,3 @@ +latest +18:04 +16.04