Created
November 1, 2018 14:41
-
-
Save tanelmae/aee8e0cb9021c94804b990af0b1c7126 to your computer and use it in GitHub Desktop.
Quick deployment to Docker Hub
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/env bash | |
set -e | |
GIT_TAG=$(git rev-parse --short HEAD) | |
USERNAME=$(docker info | sed '/Username:/!d;s/.* //') | |
TOOL_NAME=$(basename $(pwd)) | |
IMAGE_NAME="${USERNAME}/${TOOL_NAME}:${GIT_TAG}" | |
docker build -t ${IMAGE_NAME} . | |
docker push ${IMAGE_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment