-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker.mk
38 lines (34 loc) · 1.28 KB
/
docker.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## detect ARCH for buildx
ARCH :=$(shell uname -m)
export ARCH
ifeq ($(ARCH),x86_64)
TARGET :=amd64
export TARGET
endif
ifeq ($(ARCH),arm64)
TARGET :=arm64
export TARGET
endif
DOCKER=$(shell which docker)
export DOCKER
PWD=$(shell echo `pwd`)
export PWD
default:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?##/ {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
-include Makefile
dockerx:docker-buildx## docker-buildx
docker-build:## ocker build -f Dockerfile -t gnostr-command .
@./gnostr-command-docker -df start
@$(DOCKER) pull ghcr.io/gnostr-org/gnostr-command:latest
@$(DOCKER) build -f Dockerfile -t gnostr-command .
docker-buildx:## docker buildx build sequence
@./gnostr-command-docker -df start
@$(DOCKER) run --privileged --rm tonistiigi/binfmt --install all
@$(DOCKER) buildx ls
@$(DOCKER) buildx create --use --name gnostr-command-buildx || true
@$(DOCKER) buildx build -t gnostr-command --platform linux/arm64,linux/amd64 .
@$(DOCKER) buildx build -t gnostr-command --platform linux/$(TARGET) . --load
docker-package-buildx:
@docker build . --tag ghcr.io/gnostr-org/gnostr-command:latest
docker-package-pushx:
@$(DOCKER) push ghcr.io/gnostr-org/gnostr-command:latest