Add possibility to build from BASE_IMAGE

pull/570/head
Martin Boehm 2021-02-17 15:21:58 +01:00 committed by Martin
parent 212b767925
commit dcbcb99055
2 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,7 @@
BIN_IMAGE = blockbook-build
DEB_IMAGE = blockbook-build-deb
PACKAGER = $(shell id -u):$(shell id -g)
BASE_IMAGE = $$(awk -F= '$$1=="ID" { print $$2 ;}' /etc/os-release):$$(awk -F= '$$1=="VERSION_ID" { print $$2 ;}' /etc/os-release | tr -d '"')
NO_CACHE = false
TCMALLOC =
ARGS ?=
@ -44,8 +45,8 @@ build-images: clean-images
.bin-image:
@if [ $$(build/tools/image_status.sh $(BIN_IMAGE):latest build/docker) != "ok" ]; then \
echo "Building image $(BIN_IMAGE)..."; \
docker build --no-cache=$(NO_CACHE) --build-arg TCMALLOC=$(TCMALLOC) -t $(BIN_IMAGE) build/docker/bin; \
echo "Building image $(BIN_IMAGE) from $(BASE_IMAGE)"; \
docker build --no-cache=$(NO_CACHE) --build-arg TCMALLOC=$(TCMALLOC) --build-arg BASE_IMAGE=$(BASE_IMAGE) -t $(BIN_IMAGE) build/docker/bin; \
else \
echo "Image $(BIN_IMAGE) is up to date"; \
fi

View File

@ -1,6 +1,6 @@
# initialize from the image
FROM debian:9
# initialize from the image defined by BASE_IMAGE
ARG BASE_IMAGE
FROM $BASE_IMAGE
RUN apt-get update && \
apt-get upgrade -y && \