The reason why the title is not ready to match the meaning of the picture Hey!
Step 1:
Download Docker Toolbox to the Docker website and install it completely
Step 2:
After the installation is complete, run the newly generated shortcut on the desktop: Docker Quickstart Terminal
Generate a Vitrualbox virtual machine called default
Step 3:
Enter exit at QuickStart Terminal Command line interface
Enter the Vitrualbox interface
To shut down the default
Modify memory to 2G, because the default is only set 1G, installed LNMP environment is not enough
Modify the shared folder, in the same directory as the PHP code, Vitrualbox shares the C:\Users directory by default and maps to C/users
Let's change the catalogue, for example, to E:\work, map unchanged, or c/users (there is only one shared folder, try to add folders, no success)
After the modifications are complete, our hardware preparation and catalog preparation is ready.
Run the desktop again: Docker Quickstart Terminal
Step 4:
At this point, you can start to configure the Docker image.
(1) Download image
Docker pull Index.tenxcloud.com/tenxcloud/centos (foreign too slow, I use a domestic mirror source)
(2) Make a short label
sudo docker tag index.tenxcloud.com/centos:latest centos:latest (tag a short label for easy entry)
(3) Running the container
Docker Run-i-T Centos:latest/bin/bash
At this point, you can install the PHP mysql Nginx
For example, you can use Www.lnmp.org's installation package
Exit after installation LNMP complete
(4) Package new image
View the Docker containers that have just been run
Docker Ps-a
Get the container ID of the first column, for example: a1s2d3
Docker commit A1S2D3 Mydocker/dev:v1
(5) View image
Docker images
(6) Start a new image
Docker run-d-P 80:80-v/web:/www mydocker/dev:v1/sbin/init
-D is running in the background
-P is the map port
-V is the mapping directory
MYDOCKER/DEV:V1 is the name of the newly packaged image.
/sbin/init is a script or program that runs immediately after a container runs
(7) View the Docker container in operation
Docker Ps-a
(8) Manipulating Docker containers
Run, stop, restart
Docker Stop/restart/kill/start <ID/Name>
Delete Container
Docker RM $ (Docker ps-a-Q)
(9) Delete image
Docker RMI
(10) Enter root mode in Boot2docker
Docker-machine SSH Default
Sudo-i
To enter root mode
Win7+docker Build PHP Development Environment Brief