Skip to content

Instantly share code, notes, and snippets.

@secfigo
Last active February 24, 2020 00:37
Show Gist options
  • Save secfigo/4e36b8e3e782da6a6cba67e8320c327b to your computer and use it in GitHub Desktop.
Save secfigo/4e36b8e3e782da6a6cba67e8320c327b to your computer and use it in GitHub Desktop.
#!/bin/bash
# use this in vagrant config.vm.provision "shell", path: "https://gist.githubusercontent.com/secfigo/4e36b8e3e782da6a6cba67e8320c327b/raw/f1e9f6c718b764b33d8fbe9719f3f9b88231bb77/install-docker-ubuntu.sh"
### This file should be run in SUDO mode
### The script file needs to be executable, i.e.
# chmod +x script.sh
# Update package index
apt-get update
# Install tools
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# Setup stable repo
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Update package index (again)
apt-get update
# Install latest version of Docker CE
apt-get install docker-ce -y
# Run Hello World
docker run hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment