Last active
September 21, 2017 17:34
-
-
Save nolte/33a1a963d8161db0641b59f26d794e01 to your computer and use it in GitHub Desktop.
TravisCI deploy image to Dockerhub
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
#!/bin/bash | |
set -o errexit | |
DOCKER_USERNAME=$1 | |
DOCKER_PASSWORD=$2 | |
DOCKER_TAG_LOCAL=$3 | |
DOCKER_CONTAINER_NAME=$4 | |
VERSION=$5 | |
# login dockerhub | |
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | |
# change the local tag name to the target name on dockerhub | |
docker tag $DOCKER_TAG_LOCAL $DOCKER_USERNAME/$DOCKER_CONTAINER_NAME:$VERSION | |
# push the container | |
docker push $DOCKER_USERNAME/$DOCKER_CONTAINER_NAME:$VERSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment