Skip to content

Instantly share code, notes, and snippets.

@jeromy-vandusen-obs
Created September 20, 2018 13:41
Show Gist options
  • Select an option

  • Save jeromy-vandusen-obs/f2ae28192e62a8d56fc428c573225d92 to your computer and use it in GitHub Desktop.

Select an option

Save jeromy-vandusen-obs/f2ae28192e62a8d56fc428c573225d92 to your computer and use it in GitHub Desktop.

Docker on a New Virtual Machine - Installation Shortcut

After setting up a new Ubuntu Linux VM and logging in for the first time, copy/paste the following command to update the OS and tools, install Docker CE, install Docker Compose, set the Docker service to automatically start when the OS starts, and add yourself to the Docker group so that you can execute Docker commands. Immediately after submitting this command, you may be prompted for your password. After that, the process will run completely unattended, and will end with a reboot of the VM.

$ sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && sudo apt-get update && sudo apt-get install -y docker-ce && sudo usermod -aG docker $USER && sudo systemctl enable docker && sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose && sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment