Last active
April 10, 2022 10:15
-
-
Save shanduur/2fabbeeed66bc22fecb47131168e3a66 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
OS=$(uname -s) | |
ARCH=$(uname -m) | |
URL="https://github.com/docker/compose/releases/latest/download/docker-compose-${OS}-${ARCH}" | |
if [ -z ${OVERRIDE_PATH} ]; | |
then | |
INSTALL_PATH="/usr/local/lib/docker/cli-plugins/docker-compose" | |
else | |
INSTALL_PATH=${OVERRIDE_PATH} | |
fi | |
OUTPUT_PATH="./docker-compose" | |
if [ "$(whoami)" == "root" ]; | |
then | |
SUDO="" | |
else | |
SUDO="sudo" | |
fi | |
if [ ${OS} == "Linux" ] | |
then | |
echo "saving to ${OUTPUT_PATH}" | |
curl -sSL \ | |
${URL} \ | |
-o ${OUTPUT_PATH} | |
echo "installing to ${INSTALL_PATH}" | |
${SUDO} install ${OUTPUT_PATH} ${INSTALL_PATH} | |
rm -f ${OUTPUT_PATH} | |
else | |
echo "OS (${OS}) not supported" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment