makefile: rebuild test container as needed

If the Dockerfile or entrypoint.sh changes the "ci image" should be
rebuilt automatically.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2019-10-30 14:22:08 -04:00 committed by John Mulligan
parent 43a863d1cb
commit 971027692f

View File

@ -12,7 +12,7 @@ test:
test-docker: .build-docker test-docker: .build-docker
$(CONTAINER_CMD) run --device /dev/fuse --cap-add SYS_ADMIN $(CONTAINER_OPTS) --rm -it -v $(CURDIR):/go/src/github.com/ceph/go-ceph $(DOCKER_CI_IMAGE) $(CONTAINER_CMD) run --device /dev/fuse --cap-add SYS_ADMIN $(CONTAINER_OPTS) --rm -it -v $(CURDIR):/go/src/github.com/ceph/go-ceph $(DOCKER_CI_IMAGE)
.build-docker: .build-docker: Dockerfile entrypoint.sh
$(CONTAINER_CMD) build -t $(DOCKER_CI_IMAGE) . $(CONTAINER_CMD) build -t $(DOCKER_CI_IMAGE) .
@$(CONTAINER_CMD) inspect -f '{{.Id}}' $(DOCKER_CI_IMAGE) > .build-docker @$(CONTAINER_CMD) inspect -f '{{.Id}}' $(DOCKER_CI_IMAGE) > .build-docker