Skip to content

Commit

Permalink
Merge pull request #13 from dbrw/main
Browse files Browse the repository at this point in the history
Add fallback for `docker_binary` attribute
  • Loading branch information
s4ke authored Oct 11, 2023
2 parents 3327753 + 1aa78cf commit 1e46024
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker_stack_deploy/cli/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import subprocess
import collections.abc as collections
from copy import deepcopy
from shutil import which

VERBOSE: bool = (
os.getenv("DOCKER_SWARM_DEPLOY_VERBOSE") == "1"
Expand Down Expand Up @@ -235,6 +236,8 @@ def docker_stack_deploy() -> None:
docker_binary = "/bin/docker"
elif os.path.isfile("/usr/bin/docker"):
docker_binary = "/usr/bin/docker"
else:
docker_binary = which("docker")

new_cmd = [docker_binary, *forwarded_params]
if VERBOSE:
Expand Down Expand Up @@ -278,6 +281,8 @@ def usage() -> None:
docker_binary = "/bin/docker"
elif os.path.isfile("/usr/bin/docker"):
docker_binary = "/usr/bin/docker"
else:
docker_binary = which("docker")
subprocess.check_call(
[docker_binary, "stack", "deploy", "--help"],
env={
Expand Down

0 comments on commit 1e46024

Please sign in to comment.