Skip to content

Commit

Permalink
Support docker compose fallback for older docker versions that do not
Browse files Browse the repository at this point in the history
have the compose plugin
  • Loading branch information
zrhoffman committed Aug 8, 2024
1 parent d5a2644 commit f12ca39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fi

# Check to see if docker compose is already installed and use it directly, if possible.
if [ ${#COMPOSECMD[@]} -eq 0 ]; then
if which docker compose >/dev/null 2>&1; then
if docker compose >/dev/null 2>&1; then
COMPOSECMD=( docker compose )
fi
fi
Expand All @@ -81,7 +81,7 @@ fi
# This is considerably slower, but allows for building on hosts without docker-compose.
if [ ${#COMPOSECMD[@]} -eq 0 ]; then
# Pin the version of docker-compose.
IMAGE="docker/compose:1.11.2"
IMAGE="docker:latest"

# We need to either mount the docker socket or export the docker host into the container.
# This allows the container to manage "sibling" containers via docker.
Expand Down Expand Up @@ -119,7 +119,7 @@ if [ ${#COMPOSECMD[@]} -eq 0 ]; then

# COMPOSECMD is kept as an array to significantly simplify handling paths that contain
# spaces and other special characters.
COMPOSECMD=(docker run --rm "${DOCKER_ADDR[@]}" $COMPOSE_OPTIONS "${VOLUMES[@]}" -w "$(pwd)" $IMAGE)
COMPOSECMD=(docker run --rm "${DOCKER_ADDR[@]}" $COMPOSE_OPTIONS "${VOLUMES[@]}" -w "$(pwd)" $IMAGE docker compose)
fi

# Parse command line arguments
Expand Down

0 comments on commit f12ca39

Please sign in to comment.