Skip to content

Commit

Permalink
fix: install-docker-compose script without sudo if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
abmruman committed Mar 31, 2020
1 parent 0266984 commit a84eea7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions scripts/install-docker-compose.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#!/bin/bash
set -ev
set -ex

if [ -z "$DOCKER_COMPOSE_VERSION" ]; then
DOCKER_COMPOSE_VERSION=1.25.4
fi

echo "Installing docker-compose version: $DOCKER_COMPOSE_VERSION"

sudo rm /usr/local/bin/docker-compose | echo
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
sudo chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
if [ -z "`sudo -l 2>/dev/null`" ]; then

rm /usr/local/bin/docker-compose | echo
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
mv docker-compose /usr/local/bin
else
sudo rm /usr/local/bin/docker-compose | echo
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
sudo chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
fi

0 comments on commit a84eea7

Please sign in to comment.