Skip to content

Commit

Permalink
Merge pull request #2 from niklashhh/main
Browse files Browse the repository at this point in the history
add curl error handling
  • Loading branch information
Atihinen authored Jan 25, 2023
2 parents 01f5f02 + 496457b commit 07e859b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ Vagrant.configure("2") do |config|
usermod -a -G docker vagrant
# install docker-compose
mkdir -p /home/vagrant/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o /home/vagrant/.docker/cli-plugins/docker-compose
TMPFILE=$(mktemp)
http_code=$(curl -SL -w "%{http_code}" https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o "$TMPFILE")
[[ "$http_code" == "200" ]] || { rm "$TMPFILE"; echo "Curl failed with $http_code"; exit 1; }
mv "$TMPFILE" /home/vagrant/.docker/cli-plugins/docker-compose
chmod +x /home/vagrant/.docker/cli-plugins/docker-compose
ln -s /home/vagrant/.docker/cli-plugins/docker-compose /usr/local/bin/docker-compose
SHELL
Expand Down

0 comments on commit 07e859b

Please sign in to comment.