An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
July 16, 2021 07:13 am GMT
Original Link: https://dev.to/simerca/best-makefile-for-docker-project-m1-compatible-516p
Best Makefile for Docker project (M1 Compatible)
Hi !
Here is the best Makefile ever,
It's now easy to use Registry Gitlab to push your docker images and use repo name as image name.
REGISTRY_ID=$(shell grep gitlab.com .git/config|sed 's/url = https:\/\//registry./g'|sed -e "s/\.git$$//g"|xargs)TAG=$(shell git symbolic-ref --short -q HEAD|sed -e 's/master$$/latest/g'|sed 's/\([a-zA-Z]*\)\//\1-/g')build: docker build -t $(REGISTRY_ID):$(TAG) .run: build docker run --rm $(REGISTRY_ID):$(TAG) dev: docker run --rm $(REGISTRY_ID):$(TAG) pushm1: docker buildx build --platform linux/amd64 --push -t $(REGISTRY_ID):$(TAG) .buildm1: docker buildx build --platform linux/amd64 -t $(REGISTRY_ID):$(TAG) .
Original Link: https://dev.to/simerca/best-makefile-for-docker-project-m1-compatible-516p
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To