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:
24
Makefile
24
Makefile
@@ -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
26
make/docker.makefile
Normal 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
0
make/kaniko.makefile
Normal file
0
make/truenas.makefile
Normal file
0
make/truenas.makefile
Normal file
Reference in New Issue
Block a user