Skip to content

Instantly share code, notes, and snippets.

@miguelmota miguelmota/Makefile
Last active Jul 17, 2019

What would you like to do?
Makefile docker push to AWS Elastic Container Registry (ECR)
# Login to AWS registry (must have docker running)
$$(aws ecr get-login --no-include-email --region us-east-1 --profile=mycompany)
# Build docker target
docker build -f Dockerfile --no-cache -t mycompany/myapp .
# Tag docker image
$(eval REV=$(shell git rev-parse HEAD | cut -c1-7))
docker tag mycompany/myapp:latest
docker tag mycompany/myapp:latest$(REV)
# Push to registry
$(eval REV=$(shell git rev-parse HEAD | cut -c1-7))
docker push
docker push$(REV)
# Build docker image and push to AWS registry
docker/build-and-push: docker/registry/login docker/build docker/image/tag docker/registry/push 

This comment has been minimized.

Copy link

commented Jan 11, 2019

saved my life

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.