Skip to content

Commit 3c9e9cf

Browse files
authored
Merge pull request syslog-ng#5135 from HofiOne/dbdl-support-no-tty
dbld: do not try to get pseudo terminal when TTY is not available
2 parents 8ea218d + b70fdde commit 3c9e9cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dbld/rules

+4-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ GIT_RELEASE_TAG=syslog-ng-$(VERSION)
5656
CONFIGURE_OPTS=--enable-debug --enable-manpages --with-python=3 --prefix=/install $(CONFIGURE_ADD)
5757
DBLD_RULES=$(MAKE) --no-print-directory -f $(DBLD_DIR)/rules
5858

59-
DOCKER_SHELL=$(DOCKER) run $(DOCKER_RUN_ARGS) --rm -ti ${CONTAINER_REGISTRY}/dbld-$* /dbld/shell $(if $(SHELL_COMMAND),"$(SHELL_COMMAND)",bash)
59+
DOCKER_INTERACTIVE=$(shell if tty -s; then echo "-ti"; else echo "-i"; fi)
60+
DOCKER_SHELL=$(DOCKER) run $(DOCKER_RUN_ARGS) --rm -${DOCKER_INTERACTIVE} ${CONTAINER_REGISTRY}/dbld-$* /dbld/shell $(if $(SHELL_COMMAND),"$(SHELL_COMMAND)",bash)
6061

6162
-include $(if $(RULES_CONF),$(RULES_CONF),$(DBLD_DIR)/rules.conf)
6263

@@ -205,7 +206,7 @@ clean:
205206
run: run-$(DEFAULT_IMAGE)
206207
run: RUN_COMMAND=echo Specify RUN_COMMAND to do something sensible here
207208
run-%: setup
208-
$(DOCKER) run $(DOCKER_RUN_ARGS) --rm -ti ${CONTAINER_REGISTRY}/dbld-$* bash -c "$(RUN_COMMAND)"
209+
$(DOCKER) run $(DOCKER_RUN_ARGS) --rm ${DOCKER_INTERACTIVE} ${CONTAINER_REGISTRY}/dbld-$* bash -c "$(RUN_COMMAND)"
209210

210211
shell: shell-$(DEFAULT_IMAGE)
211212
shell-%: setup
@@ -261,7 +262,7 @@ exec: exec-$(DEFAULT_IMAGE)
261262
exec: EXEC_COMMAND=echo Specify EXEC_COMMAND to do something sensible here
262263
exec-%: setup
263264
@container=`$(DOCKER) ps | grep dbld-$* | head -1 | cut -d ' ' -f1`; \
264-
$(DOCKER) exec -ti $$container $(EXEC_COMMAND)
265+
$(DOCKER) exec ${DOCKER_INTERACTIVE} $$container $(EXEC_COMMAND)
265266

266267
login: login-$(DEFAULT_IMAGE)
267268
login-%: EXEC_COMMAND=sudo -u $(shell whoami) /dbld/shell

0 commit comments

Comments
 (0)