Skip to content

Instantly share code, notes, and snippets.

@tanelmae
Created November 1, 2018 14:41
Show Gist options
  • Save tanelmae/aee8e0cb9021c94804b990af0b1c7126 to your computer and use it in GitHub Desktop.
Save tanelmae/aee8e0cb9021c94804b990af0b1c7126 to your computer and use it in GitHub Desktop.
Quick deployment to Docker Hub
#!/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