spearhead-docker-cli/triton-docker

32 lines
1.2 KiB
Plaintext
Raw Normal View History

2017-05-19 20:17:38 +03:00
#!/bin/bash
set -e
# Check if triton is installed and executable
command -v triton >/dev/null 2>&1 || { echo >&2 "Triton CLI tools do not appear to be installed. Please install before continuing."; exit 1; }
# Check if the helper Go binary is installed and executable
# ...install it if not
if [ ! -f /usr/local/bin/triton-docker-helper ] || [ ! -x /usr/local/bin/triton-docker-helper ]
then
echo "Triton-docker needs to install an application to continue."
echo "This installation will only happen once."
# Check if triton is installed and executable
command -v curl >/dev/null 2>&1 || { echo >&2 "curl is required to complete this installation. Please install before continuing."; exit 1; }
2017-05-19 20:17:38 +03:00
rm -Rf /tmp/triton-docker /usr/local/bin/triton-docker-helper
mkdir -p /tmp/triton-docker
curl https://get.docker.com/builds/$(uname -a | awk '{ print $1 }')/x86_64/docker-1.12.6.tgz | tar zxvf - -C /tmp/triton-docker
2017-05-19 20:17:38 +03:00
mv /tmp/triton-docker/docker/docker /usr/local/bin/triton-docker-helper
rm -Rf /tmp/triton-docker
chmod +x /usr/local/bin/triton-docker-helper
echo "The triton-docker-helper is now installed."
echo
fi
eval "$(triton env)"
2017-05-19 20:24:25 +03:00
exec /usr/local/bin/triton-docker-helper $@