docker It's kind of like virtual machine technology , A virtual machine is hardware that simulates all or part of it , I have my own operating system , and docker No , It's just a process , This process is called container , This is called container technology , Or isolation technology , It doesn't start another operating system , Because it's too resource intensive , It's too slow , It's isolated linux kernel , Have your own space , for instance , Their own root account number , Disk condition, etc . It's very light and very heavy , It starts very quickly , One machine can start many docker Process of container .
Let's talk about a few application scenarios , There's no reason why you don't use it .
- Front end engineer , Don't understand configuration php or java Development environment of
- Continuous integration testing
- Rapid deployment , A command , The environment is as like as two peas
- As a nodejs The programmer , Don't understand, php or ruby, Want to deploy the applications they write , A command
- It is convenient to configure the resources of the program , For example, process monitoring , Memory limit
- It's too slow to install the software , Such as installation mongodb, It takes a long time to download , and docker You can run with just one command
2. mac Lower installation
Click on here Download the latest mac Version of the installation program .
Click Install Package to download it , Can run .
3. linux Lower installation
One command is enough .
curl -sSL https://get.daocloud.io/docker | sh
This order is in ubuntu 14.04 and ubuntu 16.04 Can be successfully installed docker.
After successful installation , It might prompt you with such information :
If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like: sudo usermod -aG docker vagrant Remember that you will have to log out and back in for this to take effect!
vagrant It's your user name , Maybe your user name is different from mine .
That is to say , You can add current users to docker Group , We need to manage in the future docker It's much more convenient , Otherwise, you may have to use it later docker Before the command , We need to put it in front
If not added
sudo It's a hint like this :
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/json: dial unix /var/run/docker.sock: connect: permission denied
But I did
sudo usermod -aG docker vagrant after , You log in again (ssh), You don't have to add
Installation successful , Need to put docker This service starts up ：
If it is ubuntu 14.04 The system of , It will start automatically , You can also use the following command to start .
$ sudo /etc/init.d/docker start
If it is ubuntu 16.04 The system of , Just use the following command ：
$ sudo systemctl status docker.service
The end .