|sudo apt-get install apt-transport-https ca-certificates -y|
|sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D|
|sudo rm -f /etc/apt/sources.list.d/docker.list|
|sudo add-apt-repository \|
|"deb [arch=amd64] https://download.docker.com/linux/ubuntu \|
|$(lsb_release -u -cs) \|
|sudo apt-get update|
|sudo apt-get purge lxc-docker|
|sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual|
|sudo apt-get install docker-engine|
|sudo service docker start|
|sudo groupadd docker|
|sudo usermod -aG docker $USER|
|# NOTE: you'll need to exit and reenter the shell before your user is actually recognised as part of the 'docker' group.|
Thanks for sharing!
You can also install docker-ce with this snippet but need to change according to this, https://store.docker.com/editions/community/docker-ce-server-ubuntu
@p202pbrianmackey you need to add your user to the docker group (ref https://docs.docker.com/engine/installation/linux/linux-postinstall/)
I encountered one problem. Line 4 wouldn't execute properly. I needed to execute this script in a root terminal. Even prepending
After adding your user to the docker group you also need to log out and back in. Correct me if I'm wrong but this is the case with ubuntu16 server.
BTW thanks for this gist. It really saved me time.
I noticed I couldn't use docker without sudo. I changed the last line to this:
I'm using scripts to automate certain things on my laptop and server so I copied this script with slight changes. So far I am not having any issues with my version. Credit goes to @ChrisTimperley of course.
I would just change line 5 to
for eOS loki. The one from the Docker dev site wants to put loki install of xenial. I am not sure of a way to eOS's ubuntu codename base
You can stick to the docker tutorial completely. https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#set-up-the-repository
It's very similar to @NathanTheGr8 answer, though. It's just future proof for all elementary versions.
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -u -cs) \ stable"
The script failed on my system ... Loki Linux 4.13.0-32-generic
I followed the installation guide on Docker and replace the "loki" lsb_release by "xenial" and everything works :
sudo apt-get update