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)…

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) .

Print Share Comment Cite Upload Translate
APA
Ayrton | Sciencx (2024-03-28T23:31:55+00:00) » Best Makefile for Docker project (M1 Compatible). Retrieved from https://www.scien.cx/2021/07/16/best-makefile-for-docker-project-m1-compatible/.
MLA
" » Best Makefile for Docker project (M1 Compatible)." Ayrton | Sciencx - Friday July 16, 2021, https://www.scien.cx/2021/07/16/best-makefile-for-docker-project-m1-compatible/
HARVARD
Ayrton | Sciencx Friday July 16, 2021 » Best Makefile for Docker project (M1 Compatible)., viewed 2024-03-28T23:31:55+00:00,<https://www.scien.cx/2021/07/16/best-makefile-for-docker-project-m1-compatible/>
VANCOUVER
Ayrton | Sciencx - » Best Makefile for Docker project (M1 Compatible). [Internet]. [Accessed 2024-03-28T23:31:55+00:00]. Available from: https://www.scien.cx/2021/07/16/best-makefile-for-docker-project-m1-compatible/
CHICAGO
" » Best Makefile for Docker project (M1 Compatible)." Ayrton | Sciencx - Accessed 2024-03-28T23:31:55+00:00. https://www.scien.cx/2021/07/16/best-makefile-for-docker-project-m1-compatible/
IEEE
" » Best Makefile for Docker project (M1 Compatible)." Ayrton | Sciencx [Online]. Available: https://www.scien.cx/2021/07/16/best-makefile-for-docker-project-m1-compatible/. [Accessed: 2024-03-28T23:31:55+00:00]
rf:citation
» Best Makefile for Docker project (M1 Compatible) | Ayrton | Sciencx | https://www.scien.cx/2021/07/16/best-makefile-for-docker-project-m1-compatible/ | 2024-03-28T23:31:55+00:00
https://github.com/addpipe/simple-recorderjs-demo