Linux under the Docker installation configuration tutorial

  • 2020-05-24 06:30:05
  • OfStack

To install Docker on Linux, there are several steps:

Environment: windows7

Virtual machine: Oracle VMVirtualBox

Linux: ubuntukylin-14.04.1-amd64.iso

JDK:1.7

1. Environmental preparation

step1: install the virtual machine

BIOS step2: modify the host machine configuration, detailed steps see article: https: / / www ofstack. com article / 96239. htm

step3: install the ubuntu system on the virtual machine. The memory is set to 4G, the hard disk is set to 100G, and the rest are set as default, 1 directly selects the next step. Until the system is installed successfully.

2. Install docker

step1: set the password for root

Enter sudo passwd root enter the password twice and the change is complete

step2: switch to root user

Enter su root enter, enter the password, the switch is successful

step3: start installing docker

1. Installation through the system's own package (effective for in-person testing)

Enter the following command:


sudo apt-get update
sudo apt-get install -y docker.io
sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
sudo sed -i '$acomplete -F _docker docker'/etc/bash_completion.d/docker

Install at the command prompt until successful.

Enter the command docker version, and the version information of docker appears to be 1.6.2. The installation was successful.

2. If you want to install a newer version, you can do so by using the Docker source (untested, logged)

You need to install apt-transport-https support first, and then install it by adding sources

Enter the following command:


sudo apt-getinstall apt-transport-https
sudo apt-key adv--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C895
sudo bash -c"echo deb https://get.docker.io/ubuntu docker main >/etc/apt/sources.list
sudo apt-get update
sudo apt-getinstall lxc-docker

Related articles: