Created
August 22, 2019 13:58
-
-
Save bcho/380b4ada0af1b8e059637074f166caee to your computer and use it in GitHub Desktop.
docker image building with semantic tag
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
#!/usr/bin/bash | |
set -e | |
TAG="$1" | |
if [[ -z "$TAG" ]] | |
then | |
date_version=$(date "+%Y%m%d") | |
head_commit=$(git rev-parse --short HEAD) | |
TAG="${date_version}-${head_commit}" | |
fi | |
docker build \ | |
-t cool-project:"${TAG}" \ | |
-f docker/Dockerfile \ | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment