mirror of
https://github.com/ceph/go-ceph
synced 2025-01-08 23:10:08 +00:00
make: add support for running test-docker on SElinux enabled systems
When running 'make test-docker' on Fedora with SElinux in Enforcing mode, fetching dependencies for the project fails. It seems the volume is not accessible to the container. Enabling SElinux for the volume (by passing the :z flag) makes it work. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
72c262c493
commit
cb575930e6
8
Makefile
8
Makefile
@ -1,6 +1,12 @@
|
||||
DOCKER_CI_IMAGE = go-ceph-ci
|
||||
CONTAINER_CMD := docker
|
||||
CONTAINER_OPTS := --security-opt apparmor:unconfined
|
||||
VOLUME_FLAGS :=
|
||||
|
||||
SELINUX := $(shell getenforce 2>/dev/null)
|
||||
ifeq ($(SELINUX),Enforcing)
|
||||
VOLUME_FLAGS = :z
|
||||
endif
|
||||
|
||||
build:
|
||||
go build -v
|
||||
@ -10,7 +16,7 @@ test:
|
||||
go test -v ./...
|
||||
|
||||
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$(VOLUME_FLAGS) $(DOCKER_CI_IMAGE)
|
||||
|
||||
.build-docker: Dockerfile entrypoint.sh
|
||||
$(CONTAINER_CMD) build -t $(DOCKER_CI_IMAGE) .
|
||||
|
Loading…
Reference in New Issue
Block a user