Skip to content

Instantly share code, notes, and snippets.

@adigunhammedolalekan
Last active February 18, 2020 23:50
Show Gist options
  • Save adigunhammedolalekan/9da85498bb8924eaaf02e8cfcea02421 to your computer and use it in GitHub Desktop.
Save adigunhammedolalekan/9da85498bb8924eaaf02e8cfcea02421 to your computer and use it in GitHub Desktop.
#!/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