Last active
August 31, 2019 21:09
-
-
Save victorpaulo/ca1485075a63f88ac20b8b2032d5fd2b to your computer and use it in GitHub Desktop.
Docker Registry Operations
This file contains 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
APP=ace-dev | |
VERSION=v1.0 | |
DOCKER_REGISTRY=registry.local.tld:5000 | |
CURL_DIGEST:=$(shell curl -v --silent -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' \ | |
-X GET http://$(DOCKER_REGISTRY)/v2/$(APP)/manifests/$(VERSION) 2>&1 | grep Docker-Content-Digest | awk '{print $$3}') | |
.PHONY: build | |
build: | |
docker build --rm -t $(DOCKER_REGISTRY)/$(APP):$(VERSION) . | |
.PHONY: push | |
push: | |
docker push $(DOCKER_REGISTRY)/$(APP):$(VERSION) | |
.PHONY: del-docker-registry | |
del-docker-registry: | |
echo "$(CURL_DIGEST)" | |
curl -v --silent -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \ | |
-X DELETE http://$(DOCKER_REGISTRY)/v2/$(APP)/manifests/$(CURL_DIGEST) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment