Switch to multi-makefile strategy

Instead of putting everything in one makefile switch to a folder called
"make" with multiple makefiles. Move the original makefile to
"docker.makefile" and add kaniko and truenas to fill in later.
This commit is contained in:
ducoterra
2021-10-31 15:03:59 -04:00
parent f18752299d
commit 8a52a21a39
4 changed files with 29 additions and 21 deletions

View File

@@ -4,24 +4,6 @@ IMAGE ?= $(shell cat IMAGE):$(shell cat VERSION)
IMAGE_LATEST ?= $(shell cat IMAGE):latest IMAGE_LATEST ?= $(shell cat IMAGE):latest
PWD ?= $(shell pwd) PWD ?= $(shell pwd)
.PHONY: buildx-context include make/docker.makefile
buildx-context: include make/kaniko.makefile
docker buildx create --name arm64 --use --platform linux/amd64,linux/arm64 include make/truenas.makefile
.PHONY: buildx-clear
buildx-clear:
docker buildx rm arm64
.PHONY: build
build:
docker buildx build --load . -t $(IMAGE)
@docker buildx build --load . -t $(IMAGE_LATEST)
.PHONY: push
push:
docker buildx build --platform linux/amd64 --push . -t $(IMAGE)
@docker buildx build --platform linux/amd64 --push . -t $(IMAGE_LATEST)
.PHONY: run
run:
docker run -it -v $(PWD):/mc_data $(IMAGE) bash

26
make/docker.makefile Normal file
View File

@@ -0,0 +1,26 @@
.PHONY: docker-init
docker-init:
@touch VERSION
@touch IMAGE
.PHONY: buildx-context
buildx-context:
docker buildx create --name arm64 --use --platform linux/amd64,linux/arm64
.PHONY: buildx-clear
buildx-clear:
docker buildx rm arm64
.PHONY: build
build:
docker buildx build --load . -t $(IMAGE)
@docker buildx build --load . -t $(IMAGE_LATEST)
.PHONY: push
push:
docker buildx build --platform linux/amd64 --push . -t $(IMAGE)
@docker buildx build --platform linux/amd64 --push . -t $(IMAGE_LATEST)
.PHONY: run
run:
docker run -it -v $(PWD):/mc_data $(IMAGE) bash

0
make/kaniko.makefile Normal file
View File

0
make/truenas.makefile Normal file
View File