Last active
February 18, 2020 23:50
-
-
Save adxgun/9da85498bb8924eaaf02e8cfcea02421 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# Generate a random uuid to use as a docker tag | |
NEW_UUID=$(cat /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1) | |
# build binary | |
export GOOS=linux && go build -o sample-auth main.go | |
# build docker image | |
docker build -t "sample-auth" . | |
# tag image | |
docker tag sample-auth localhost:5010/sample-auth:${NEW_UUID} | |
# push image to registry running at localhost:5010 | |
docker push localhost:5010/sample-auth:${NEW_UUID} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment