Skip to content

Commit

Permalink
Fix docker compose invocation
Browse files Browse the repository at this point in the history
1. Make sure we don't call docker-compose if 'docker compose' is available
2. Automatically build the container (will be cached by docker, so no overhead) (fixes fauxpilot#140)

Signed-off-by: Parth Thakkar <[email protected]>
  • Loading branch information
thakkarparth007 committed Jan 24, 2023
1 parent 4441e5e commit 99e41d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ while getopts "hd" option; do
esac
done

# On newer versions, docker-compose is docker compose
docker compose up $options --remove-orphans || docker-compose up $options --remove-orphans
# On versions above 20.10.2, docker-compose is docker compose
smaller=$(printf "$(docker --version | egrep -o '[0-9]+\.[0-9]+\.[0-9]+')\n20.10.2" | sort -V | head -n1)
if [[ "$smaller" == "20.10.2" ]]; then
docker compose up $options --remove-orphans --build
else
docker-compose up $options --remove-orphans --build
fi;

0 comments on commit 99e41d7

Please sign in to comment.