37 lines
1,015 B
Makefile
37 lines
1,015 B
Makefile
|
|
||
|
FROM_IMAGE_NAME := r.thisco.de/debian
|
||
|
FROM_IMAGE_TAG := latest
|
||
|
VERSION := bullseye
|
||
|
|
||
|
BASE_ROOTFS := base-rootfs
|
||
|
BASE_TMP := base-rootfs-tmp
|
||
|
BASE_IMAGE_NAME := r.thisco.de/debian
|
||
|
BASE_IMAGE_TAG := $(VERSION)
|
||
|
|
||
|
default: base
|
||
|
|
||
|
.PHONY: rootfs.tar.gz
|
||
|
|
||
|
rootfs.tar.gz: Dockerfile.rootfs build-rootfs.sh
|
||
|
docker build --build-arg "IMAGENAME=$(FROM_IMAGE_NAME)" --build-arg "IMAGETAG=$(FROM_IMAGE_TAG)" --build-arg "VERSION=$(VERSION)" -t "$(BASE_ROOTFS)" -f Dockerfile.rootfs . && \
|
||
|
docker create --name=$(BASE_TMP) "$(BASE_ROOTFS)" && \
|
||
|
docker cp $(BASE_TMP):/rootfs.tar.gz . && \
|
||
|
docker rm -f $(BASE_TMP)
|
||
|
|
||
|
.PHONY: base
|
||
|
|
||
|
base: rootfs.tar.gz Dockerfile.base
|
||
|
docker build -t $(BASE_IMAGE_NAME) -f Dockerfile.base . && \
|
||
|
docker run -it --rm $(BASE_IMAGE_NAME) echo success && \
|
||
|
docker tag $(BASE_IMAGE_NAME) $(BASE_IMAGE_NAME):$(BASE_IMAGE_TAG)
|
||
|
|
||
|
.PHONY: push
|
||
|
push: base
|
||
|
docker push $(BASE_IMAGE_NAME) && \
|
||
|
docker push $(BASE_IMAGE_NAME):$(BASE_IMAGE_TAG)
|
||
|
|
||
|
clean:
|
||
|
rm -f rootfs.tar.gz && \
|
||
|
docker rmi $(BASE_ROOTFS)
|
||
|
|