Skip to content

Instantly share code, notes, and snippets.

@Mikulas
Created September 13, 2017 13:22
Show Gist options
  • Save Mikulas/8e2ce854b7d88bedf5e78d9f3c43b0d8 to your computer and use it in GitHub Desktop.
Save Mikulas/8e2ce854b7d88bedf5e78d9f3c43b0d8 to your computer and use it in GitHub Desktop.
IMAGE = mangoweb/golang-build
TAG = latest
all: build publish
build: Dockerfile
docker build -t "${IMAGE}" .
publish: Dockerfile
docker tag "${IMAGE}" "${IMAGE}:${TAG}"
docker push "${IMAGE}:${TAG}"
- if [ $(TAG) != "latest" ]; then\
- docker tag "${IMAGE}" "${IMAGE}:latest";\
+ docker tag "${IMAGE}" "${IMAGE}:latest"
- docker push "${IMAGE}:latest";\
+ docker push "${IMAGE}:latest"
- fi
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment