Docker:Install
Ubuntu
## Recommended extra packages
$ sudo apt-get update
$ sudo apt-get -y install curl linux-image-extra-$(uname -r) linux-image-extra-virtual
## Set up the repository
$ sudo apt-get -y install apt-transport-https software-properties-common ca-certificates
## Add Docker’s official GPG key:
$ curl -fsSL https://yum.dockerproject.org/gpg | sudo apt-key add -
$ apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
## set up the stable repository.
$ sudo apt-get -y install software-properties-common
$ sudo add-apt-repository "deb https://apt.dockerproject.org/repo/ ubuntu-$(lsb_release -cs) main"
## Install Docker
$ sudo apt-get update
$ sudo apt-get -y install docker-engine
## [OR] specific version:
$ apt-cache madison docker-engine # list of versions.
$ sudo apt-get -y install docker-engine=<VERSION_STRING> # e.g) sudo apt-get -y install docker-engine=1.12.6-0~ubuntu-trusty
## [OPTIONAL] Create a Docker group
$ sudo usermod -aG docker [USER_NAME]
old install version
Warning |
Note: the docker.io package from the standard repository for Ubuntu 14.04 is very old (version 0.9.1). To use Shipyard, you will need to install the most recent version of Docker using one of the methods listed above. |
Update your apt sources:
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Open the /etc/apt/sources.list.d/docker.list
file in your favorite editor. If the file doesn’t exist, create it.
## On Ubuntu Precise 12.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-precise main
## On Ubuntu Trusty 14.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-trusty main
## On Ubuntu Vivid 15.04
deb https://apt.dockerproject.org/repo ubuntu-vivid main
## Ubuntu Wily 15.10
deb https://apt.dockerproject.org/repo ubuntu-wily main
And...
## Update the apt package index.
$ apt-get update
## Purge the old repo if it exists.
$ apt-get purge lxc-docker
## Verify that apt is pulling from the right repository.
$ apt-cache policy docker-engine
Prerequisites by Ubuntu Version:
- Ubuntu Wily 15.10
- Ubuntu Vivid 15.04
- Ubuntu Trusty 14.04 (LTS)
## Update your package manager.
$ sudo apt-get update
## Install the recommended package.
$ sudo apt-get install linux-image-extra-$(uname -r)
## If you are installing on Ubuntu 14.04 or 12.04, apparmor is required. You can install it using:
$ sudo apt-get install apparmor
Warning |
Ubuntu Precise 12.04 (LTS) see this post. |
Install:
## Update your apt package index.
$ sudo apt-get update
## Install Docker.
$ sudo apt-get install docker-engine
## Start the docker daemon.
$ sudo service docker start
## Verify docker is installed correctly.
$ sudo docker run hello-world
CentOS 7
$ sudo yum update
$ curl -fsSL https://get.docker.com/ | sh
$ sudo service docker start
$ sudo systemctl enable docker
Arch Linux
$ sudo pacman -S docker
$ sudo systemctl enable docker.service
$ sudo systemctl start docker.service
$ sudo usermod -aG docker $USER