Last active
April 5, 2022 14:27
-
-
Save Kylep342/d4769a4922e82a81bf22a894170a065e to your computer and use it in GitHub Desktop.
Small command to atomically build, tag, and push images to a registry
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
#!/usr/bin/env bash | |
shipt() { | |
if [[ $# -ne 3 ]]; then | |
echo 'Need 3 arguments\n1. Name of local docker tag\n2. Path to local dockerfile\n3. Name of remote docker registry' | |
else | |
docker build --tag $1 $2; | |
docker image tag $1 $3/$1; | |
docker image push $3/$1; | |
fi | |
} | |
shipt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment