Skip to content

Commit 48252d2

Browse files
Mehonoshintraefiker
authored andcommitted
Allow to run docker from Makefile in non-interactive mode
1 parent 125470f commit 48252d2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ TRAEFIK_ENVS := \
3131

3232
TRAEFIK_MOUNT := -v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/containous/traefik/$(BIND_DIR)"
3333
DOCKER_RUN_OPTS := $(TRAEFIK_ENVS) $(TRAEFIK_MOUNT) "$(TRAEFIK_DEV_IMAGE)"
34-
DOCKER_RUN_TRAEFIK := docker run $(INTEGRATION_OPTS) -it $(DOCKER_RUN_OPTS)
35-
DOCKER_RUN_TRAEFIK_NOTTY := docker run $(INTEGRATION_OPTS) -i $(DOCKER_RUN_OPTS)
34+
DOCKER_NON_INTERACTIVE ?= false
35+
DOCKER_RUN_TRAEFIK := docker run $(INTEGRATION_OPTS) $(if $(DOCKER_NON_INTERACTIVE), , -it) $(DOCKER_RUN_OPTS)
36+
DOCKER_RUN_TRAEFIK_NOTTY := docker run $(INTEGRATION_OPTS) $(if $(DOCKER_NON_INTERACTIVE), , -i) $(DOCKER_RUN_OPTS)
3637

3738
PRE_TARGET ?= build-dev-image
3839

docs/content/contributing/building-testing.md

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ For changes to its dependencies, the `dep` dependency management tool is require
1616
Run make with the `binary` target.
1717
This will create binaries for the Linux platform in the `dist` folder.
1818

19+
In case when you run build on CI, you may probably want to run docker in non-interactive mode. To achieve that define `DOCKER_NON_INTERACTIVE=true` environment variable.
20+
1921
```bash
2022
$ make binary
2123
docker build -t traefik-webui -f webui/Dockerfile webui

0 commit comments

Comments
 (0)