Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!/bin/bash
  2. set -o errexit
  3.  
  4. DOCKER_USERNAME=$1
  5. DOCKER_PASSWORD=$2
  6.  
  7. DOCKER_TAG_LOCAL=$3
  8. DOCKER_CONTAINER_NAME=$4
  9. VERSION=$5
  10.  
  11. # login dockerhub
  12. docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  13.  
  14. # change the local tag name to the target name on dockerhub
  15. docker tag $DOCKER_TAG_LOCAL $DOCKER_USERNAME/$DOCKER_CONTAINER_NAME:$VERSION
  16.  
  17. # push the container
  18. docker push $DOCKER_USERNAME/$DOCKER_CONTAINER_NAME:$VERSION
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement