makefile: add a variable for passing additional container build options

The one I often use is "--no-cache" to force a rebuild. Adding a var to
the makefile makes it so I don't have to get too hacky with it.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2021-08-26 11:09:06 -04:00 committed by mergify[bot]
parent c7fb7aaa7c
commit ac2e61a699
1 changed files with 2 additions and 0 deletions

View File

@ -1,6 +1,7 @@
CI_IMAGE_NAME = go-ceph-ci CI_IMAGE_NAME = go-ceph-ci
CONTAINER_CMD ?= CONTAINER_CMD ?=
CONTAINER_OPTS := --security-opt $(shell grep -q selinux /sys/kernel/security/lsm 2>/dev/null && echo "label=disable" || echo "apparmor:unconfined") CONTAINER_OPTS := --security-opt $(shell grep -q selinux /sys/kernel/security/lsm 2>/dev/null && echo "label=disable" || echo "apparmor:unconfined")
CONTAINER_BUILD_OPTS :=
CONTAINER_CONFIG_DIR := testing/containers/ceph CONTAINER_CONFIG_DIR := testing/containers/ceph
VOLUME_FLAGS := VOLUME_FLAGS :=
CEPH_VERSION := octopus CEPH_VERSION := octopus
@ -164,6 +165,7 @@ $(BUILDFILE): $(CONTAINER_CONFIG_DIR)/Dockerfile entrypoint.sh micro-osd.sh
$(CONTAINER_CMD) build \ $(CONTAINER_CMD) build \
--build-arg GO_CEPH_VERSION=$(CEPH_VERSION) \ --build-arg GO_CEPH_VERSION=$(CEPH_VERSION) \
--build-arg CEPH_TAG=$(CEPH_TAG) \ --build-arg CEPH_TAG=$(CEPH_TAG) \
$(CONTAINER_BUILD_OPTS) \
-t $(CI_IMAGE_TAG) \ -t $(CI_IMAGE_TAG) \
-f $(CONTAINER_CONFIG_DIR)/Dockerfile . -f $(CONTAINER_CONFIG_DIR)/Dockerfile .
@$(CONTAINER_CMD) inspect -f '{{.Id}}' $(CI_IMAGE_TAG) > $(BUILDFILE) @$(CONTAINER_CMD) inspect -f '{{.Id}}' $(CI_IMAGE_TAG) > $(BUILDFILE)