Last active
December 1, 2019 17:33
-
-
Save dvdme/4c07608a1d1c5a3529de627e12b287ec to your computer and use it in GitHub Desktop.
Install Docker on Ubuntu 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install with instructions from Docker | |
apt-get remove docker docker-engine docker.io containerd runc | |
apt-get update | |
apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
apt-key fingerprint 0EBFCD88 | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io | |
# Fix error | |
# docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied. | |
# See 'docker run --help'. | |
groupadd docker | |
usermod -aG docker $USER | |
chmod 666 /var/run/docker.sock | |
# Verify all is good | |
docker run hello-world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment