To prepare, download VirtualBox+vagrant (many links on the Internet). After the
above two are installed, download the box mirror of vagrant centos (vagrant-centos-7.box) and execute
vagrant box add Centos7.1 https://github.com/tommy-muehle/puppet-vagrant-boxes/releases/download/1.1.0/centos-7.0-x86_64.box
Download successfully
initialize vagrant
vagrant init Centos7.1
Start centos
vagrant up
After connecting to the machine
vagrant ssh
after the above operations, we have completed the installation of the centos7 virtual machine,
and the startup is successful!
Click on the Oracle VM VirtualBox program on the desktop to see the details of Linux.
The meaning of the above paragraph is that you can press the right ctrl key to cancel the capture
But you will find that the account cannot be
logged
in, please refer to https://blog.csdn.net/github_38097011/article/details/83688607 vagrant account login Open the console in the directory location of the virtual machine vagrantfile, enter vagrant ssh-config
to log in to the virtual machine with xshell It is found that by default, it is not possible to log in to the root account with the account and password. You can only use the vagrant account and the password to
log in to the
vagrant root account. After logging in to vagrant, switch to the root account and
set the root password
passwd
In the directory of the development environment (where there is Vagrantfile), log in to the virtual machine
git shell prompting that the login is successful:
Edit the Vagrantfile file
Add the following code at the end of the Vagrantfile file:
config.vm.provision "shell", inline: <<-SHELL
apt-get update
curl -s https://get.docker.com|sh
SHELL
Installing the pagoda, I won’t go into details, but the pagoda link can’t be accessed after the installation is complete. Generally, the port is not opened.
>>> 开启端口
firewall-cmd --zone=public --add-port=8888/tcp --permanent
Just visit again:
Windows Docker installation
Docker is not a general-purpose container tool, it depends on the existing and running Linux kernel environment.
Docker essentially creates an isolated file environment under the already running Linux, so its execution efficiency is almost equal to the deployed Linux host.
Therefore, Docker must be deployed on the Linux kernel system. If other systems want to deploy Docker, they must install a virtual Linux environment.
The method of deploying Docker on Windows is to install a virtual machine first, and run Docker in the virtual machine where the Linux system is installed.
Reference resource:
https://www.jianshu.com/p/a233c1a7af98
Reference link 02
https://zhuanlan.zhihu.com/p/49538228
https://www.imooc.com/article/51215
Remember, some foreign countries When the resources (such as vagrant.box) cannot be connected, look for a domestic mirror!