Skip to content

Commit

Permalink
Merge pull request axoflow#305 from alltilla/dbdl-support-no-tty
Browse files Browse the repository at this point in the history
dbld: do not try to get pseudo terminal when TTY is not available
  • Loading branch information
bazsi authored Sep 25, 2024
2 parents fcbb8c6 + 8a739a4 commit f517dfe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dbld/rules
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ GIT_RELEASE_TAG=axosyslog-$(VERSION)
CONFIGURE_OPTS=--enable-debug --enable-manpages --with-python=3 --prefix=/install $(CONFIGURE_ADD)
DBLD_RULES=$(MAKE) --no-print-directory -f $(DBLD_DIR)/rules

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

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

Expand Down Expand Up @@ -203,7 +204,7 @@ clean:
run: run-$(DEFAULT_IMAGE)
run: RUN_COMMAND=echo Specify RUN_COMMAND to do something sensible here
run-%: setup
$(DOCKER) run $(DOCKER_RUN_ARGS) --rm -ti ${CONTAINER_REGISTRY}/axosyslog-dbld-$* bash -c "$(RUN_COMMAND)"
$(DOCKER) run $(DOCKER_RUN_ARGS) --rm $(DOCKER_INTERACTIVE) ${CONTAINER_REGISTRY}/axosyslog-dbld-$* bash -c "$(RUN_COMMAND)"

shell: shell-$(DEFAULT_IMAGE)
shell-%: setup
Expand Down Expand Up @@ -258,7 +259,7 @@ exec: exec-$(DEFAULT_IMAGE)
exec: EXEC_COMMAND=echo Specify EXEC_COMMAND to do something sensible here
exec-%: setup
@container=`$(DOCKER) ps | grep axosyslog-dbld-$* | head -1 | cut -d ' ' -f1`; \
$(DOCKER) exec -ti $$container $(EXEC_COMMAND)
$(DOCKER) exec $(DOCKER_INTERACTIVE) $$container $(EXEC_COMMAND)

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

0 comments on commit f517dfe

Please sign in to comment.