Merge pull request #2161 from AkihiroSuda/makefile-overrride-docker
Makefile: allow overriding `docker` command
This commit is contained in:
commit
e1b5af0652
15
Makefile
15
Makefile
|
@ -3,6 +3,7 @@
|
||||||
test unittest integration \
|
test unittest integration \
|
||||||
cross localcross
|
cross localcross
|
||||||
|
|
||||||
|
CONTAINER_ENGINE := docker
|
||||||
GO := go
|
GO := go
|
||||||
|
|
||||||
SOURCES := $(shell find . 2>&1 | grep -E '.*\.(c|h|go)$$')
|
SOURCES := $(shell find . 2>&1 | grep -E '.*\.(c|h|go)$$')
|
||||||
|
@ -47,7 +48,7 @@ release:
|
||||||
script/release.sh -r release/$(VERSION) -v $(VERSION)
|
script/release.sh -r release/$(VERSION) -v $(VERSION)
|
||||||
|
|
||||||
dbuild: runcimage
|
dbuild: runcimage
|
||||||
docker run ${DOCKER_RUN_PROXY} --rm -v $(CURDIR):/go/src/$(PROJECT) --privileged $(RUNC_IMAGE) make clean all
|
$(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} --rm -v $(CURDIR):/go/src/$(PROJECT) --privileged $(RUNC_IMAGE) make clean all
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
$(GO) vet $(allpackages)
|
$(GO) vet $(allpackages)
|
||||||
|
@ -57,7 +58,7 @@ man:
|
||||||
man/md2man-all.sh
|
man/md2man-all.sh
|
||||||
|
|
||||||
runcimage:
|
runcimage:
|
||||||
docker build ${DOCKER_BUILD_PROXY} -t $(RUNC_IMAGE) .
|
$(CONTAINER_ENGINE) build ${CONTAINER_ENGINE_BUILD_FLAGS} -t $(RUNC_IMAGE) .
|
||||||
|
|
||||||
test:
|
test:
|
||||||
make unittest integration rootlessintegration
|
make unittest integration rootlessintegration
|
||||||
|
@ -66,25 +67,25 @@ localtest:
|
||||||
make localunittest localintegration localrootlessintegration
|
make localunittest localintegration localrootlessintegration
|
||||||
|
|
||||||
unittest: runcimage
|
unittest: runcimage
|
||||||
docker run ${DOCKER_RUN_PROXY} -t --privileged --rm -v /lib/modules:/lib/modules:ro -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest TESTFLAGS=${TESTFLAGS}
|
$(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} -t --privileged --rm -v /lib/modules:/lib/modules:ro -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest TESTFLAGS=${TESTFLAGS}
|
||||||
|
|
||||||
localunittest: all
|
localunittest: all
|
||||||
$(GO) test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages)
|
$(GO) test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages)
|
||||||
|
|
||||||
integration: runcimage
|
integration: runcimage
|
||||||
docker run ${DOCKER_RUN_PROXY} -t --privileged --rm -v /lib/modules:/lib/modules:ro -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration TESTPATH=${TESTPATH}
|
$(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} -t --privileged --rm -v /lib/modules:/lib/modules:ro -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration TESTPATH=${TESTPATH}
|
||||||
|
|
||||||
localintegration: all
|
localintegration: all
|
||||||
bats -t tests/integration${TESTPATH}
|
bats -t tests/integration${TESTPATH}
|
||||||
|
|
||||||
rootlessintegration: runcimage
|
rootlessintegration: runcimage
|
||||||
docker run ${DOCKER_RUN_PROXY} -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localrootlessintegration
|
$(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localrootlessintegration
|
||||||
|
|
||||||
localrootlessintegration: all
|
localrootlessintegration: all
|
||||||
tests/rootless.sh
|
tests/rootless.sh
|
||||||
|
|
||||||
shell: runcimage
|
shell: runcimage
|
||||||
docker run ${DOCKER_RUN_PROXY} -ti --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) bash
|
$(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} -ti --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) bash
|
||||||
|
|
||||||
install:
|
install:
|
||||||
install -D -m0755 runc $(BINDIR)/runc
|
install -D -m0755 runc $(BINDIR)/runc
|
||||||
|
@ -119,7 +120,7 @@ validate:
|
||||||
ci: validate test release
|
ci: validate test release
|
||||||
|
|
||||||
cross: runcimage
|
cross: runcimage
|
||||||
docker run ${DOCKER_RUN_PROXY} -e BUILDTAGS="$(BUILDTAGS)" --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localcross
|
$(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} -e BUILDTAGS="$(BUILDTAGS)" --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localcross
|
||||||
|
|
||||||
localcross:
|
localcross:
|
||||||
CGO_ENABLED=1 GOARCH=arm GOARM=6 CC=arm-linux-gnueabi-gcc $(GO) build -buildmode=pie $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc-armel .
|
CGO_ENABLED=1 GOARCH=arm GOARM=6 CC=arm-linux-gnueabi-gcc $(GO) build -buildmode=pie $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc-armel .
|
||||||
|
|
Loading…
Reference in New Issue