Skip to content

Instantly share code, notes, and snippets.

@dcb9
Last active October 21, 2023 16:20
Show Gist options
  • Save dcb9/e8381bf584500bce543b to your computer and use it in GitHub Desktop.
Save dcb9/e8381bf584500bce543b to your computer and use it in GitHub Desktop.
sudo su -
# Kernels older than 3.10 lack some of the features required to run Docker containers.
uname -r
3.11.0-15-generic
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get purge lxc-docker
apt-cache policy docker-engine
apt-get install -y docker-engine linux-image-extra-$(uname -r)
usermod -aG docker ubuntu
docker run hello-world
# Install docker-compose
curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
docker-compose version: 1.5.2
# Change docker storage directory
vim /etc/default/docker
# uncomment blow line -g your storage directory
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -g /data"
service docker restart
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
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 bionic stable"
sudo apt update
sudo apt install docker-ce
sudo systemctl status docker
# docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
@abale
Copy link

abale commented Dec 3, 2017

Here is the proper way to get latest docker engine (17 as of writing) on 12.04:

apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sh -c "echo deb https://apt.dockerproject.org/repo ubuntu-precise main \
> /etc/apt/sources.list.d/docker.list"
apt-get purge lxc-docker
apt-get update
apt-get install docker-engine

@HadowStark
Copy link

@abale Your way done perfectly, thank you :)

@RGNagel
Copy link

RGNagel commented May 12, 2018

Thank you guys

@pourya2374
Copy link

Here is the proper way to get latest docker engine (17 as of writing) on 12.04:

apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sh -c "echo deb https://apt.dockerproject.org/repo ubuntu-precise main \
> /etc/apt/sources.list.d/docker.list"
apt-get purge lxc-docker
apt-get update
apt-get install docker-engine

👍

@jbilbo
Copy link

jbilbo commented Sep 6, 2019

This worked for me:

sh -c "echo deb https://apt.dockerproject.org/repo ubuntu-precise main > /etc/apt/sources.list.d/docker.list"
curl -fsSL https://yum.dockerproject.org/gpg | apt-key add -
apt-get update && apt-get -y install docker-engine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment