Skip to content

Commit ebfc17f

Browse files
committed
Update Makefile to allow building alertnate arch with Docker
1 parent f5f160c commit ebfc17f

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

debian11/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ NAME = php-apache
22
TAG = $(shell basename $(shell pwd))
33
IMAGE_NAME := panubo/$(NAME)
44

5-
.PHONY: help build push clean bash run
5+
.PHONY: help build buildarm buildamd push clean bash run
66

77
help:
88
@printf "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)\n"
99

10-
build: ## Builds docker image
10+
build: ## build image
1111
docker build --pull -t $(IMAGE_NAME):$(TAG) .
1212

13+
buildarm: ## build image
14+
docker build --platform=linux/arm64 --pull -t $(IMAGE_NAME):$(TAG) .
15+
16+
buildamd: ## build image
17+
docker build --platform=linux/amd64 --pull -t $(IMAGE_NAME):$(TAG) .
18+
1319
push: ## Push image to registry
1420
docker tag $(IMAGE_NAME):$(TAG) docker.io/$(IMAGE_NAME):latest
1521
docker push $(IMAGE_NAME):$(TAG)

debian12/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ NAME = php-apache
22
TAG = $(shell basename $(shell pwd))
33
IMAGE_NAME := panubo/$(NAME)
44

5-
.PHONY: help build push clean bash run
5+
.PHONY: help build buildarm buildamd push clean bash run
66

77
help:
88
@printf "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)\n"
99

10-
build: ## Builds docker image
10+
build: ## build image
1111
docker build --pull -t $(IMAGE_NAME):$(TAG) .
1212

13+
buildarm: ## build image
14+
docker build --platform=linux/arm64 --pull -t $(IMAGE_NAME):$(TAG) .
15+
16+
buildamd: ## build image
17+
docker build --platform=linux/amd64 --pull -t $(IMAGE_NAME):$(TAG) .
18+
1319
push: ## Push image to registry
1420
docker tag $(IMAGE_NAME):$(TAG) docker.io/$(IMAGE_NAME):latest
1521
docker push $(IMAGE_NAME):$(TAG)

0 commit comments

Comments
 (0)