Skip to content

Instantly share code, notes, and snippets.

@hiono
Last active December 20, 2021 09:58
Show Gist options
  • Save hiono/805800f242672ca15198fb151c2d86e9 to your computer and use it in GitHub Desktop.
Save hiono/805800f242672ca15198fb151c2d86e9 to your computer and use it in GitHub Desktop.
#!/bin/sh
# usage
# curl -s https://gist.githubusercontent.com/hiono/805800f242672ca15198fb151c2d86e9/raw | sudo bash
set -o errexit
set -o nounset
# Docker
apt remove --quiet --yes docker docker-engine docker.io containerd runc || true
apt update
apt --quiet --yes --no-install-recommends install apt-transport-https ca-certificates curl jq
curl -fsSL https://get.docker.com | bash
usermod --append --groups docker "$USER"
systemctl enable docker
echo 'Docker installed successfully'
# Docker Compose
rm -f /usr/local/bin/docker-compose
curl -fsSL -o - "https://github.com/docker/compose/releases/download/$(curl -fsSL https://api.github.com/repos/docker/compose/releases/latest | jq -r '.tag_name')/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# curl "https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose" | tee /etc/bash_completion.d/docker-compose
echo 'Docker Compose installed successfully'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment