Skip to content

Instantly share code, notes, and snippets.

@looztra
Last active November 27, 2017 10:35
Show Gist options
  • Save looztra/82d8d18dd36f75e99db06944c96c82de to your computer and use it in GitHub Desktop.
Save looztra/82d8d18dd36f75e99db06944c96c82de to your computer and use it in GitHub Desktop.
Fish Functions to Download docker-machine and docker-compose latest version
function compose-update -d 'Update docker-compose to version provided in param or latest release if no param provided'
set compose_version (curl -s https://api.github.com/repos/docker/compose/releases/latest | jq .tag_name | tr -d '"')
if not test -z "$argv"
set compose_version $argv
end
echo "Retreiving docker-compose version $compose_version"
echo "gna"
curl -Lo ~/tmp/docker-compose https://github.com/docker/compose/releases/download/$compose_version/docker-compose-Linux-x86_64
chmod +x ~/tmp/docker-compose ; and mv ~/tmp/docker-compose ~/.local/bin/
which docker-compose
docker-compose version
end
function machine-update -d 'Update docker-machine to version provided in param or latest release if no param provided'
set machine_version (curl -s https://api.github.com/repos/docker/machine/releases/latest | jq .tag_name | tr -d '"')
set version_type default
if not test -z "$argv"
set version_type forced
set machine_version $argv
end
echo "Retreiving docker-machine version $machine_version ($version_type)"
rm -f ~/tmp/docker-machine
curl -Lo ~/tmp/docker-machine https://github.com/docker/machine/releases/download/$machine_version/docker-machine-Linux-x86_64
chmod +x ~/tmp/docker-machine ; and mv ~/tmp/docker-machine ~/.local/bin/
which docker-machine
docker-machine version
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment