Run laradock through d4m nfs to bid farewell to the tortoise speed virtual machine
introduce
-
The PHP version: 7.0, 5.6.5.5... can be simply switched. -
You can choose your favorite database engine, such as MySQL, Postgres, MariaDB... -
You can run your own software portfolio, such as Memcached, HHVM, Beanstalkd -
All software runs in different containers, such as PHP-FPM, NGINX, PHP-CLI -
Through simple writing dockerfile Easy to customize any container. -
All images are inherited from an official base images -
The Nginx environment of Laravel can be preconfigured -
Easy to apply the configuration in the container -
Clean and structured Docker configuration file( dockerfile ) -
The latest Docker Compose version( docker-compose ) -
All are visual and editable -
Fast image building -
There will be updates every week
Docker
start
git submodule add https://github.com/LaraDock/laradock.git
If you are not using Git to manage the Larravel project, you can use
git clone Instead of
git submodule 。
git clone https://github.com/LaraDock/laradock.git
Here I suggest using method B to install globally
docker-compose up -d nginx mysql
docker-compose exec workspace bash
DB_HOST=mysql
Note that when defining DB_HOST, it must be written as MySQL, otherwise it cannot be linked to the container
It is recommended to modify the host file
127.0.0.1 www.youresite.com
D4m-nfs
git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
//Add the following mount directory to the document /Users:/Users /Volumes:/Volumes /private:/private
Cat/etc/exports//View/etc/exports # d4m-nfs exports "/Users" -alldirs -mapall=0:0 localhost "/Volumes" -alldirs -mapall=0:0 localhost "/private" -alldirs -mapall=0:0 localhost
~/d4m-nfs/d4m-nfs.sh
After the script runs, the program starts to initialize. At last, the terminal will show the following
.... Please note: * To connect to the D4M moby linux VM use: screen -r d4m * To disconnect from the D4M moby linux VM tty screen session use Ctrl-a d. * To run d4m-nfs faster and/or offline, leave the files in d4m-apk-cache and the hello-world image. * If you switch between D4M stable and beta, you might need to remove files in d4m-apk-cache and the hello-world image. # Use Stable Docker for Mac channel Currently d4m-nfs is known to work on 'Docker version 1.12.3' and does not work on Docker for Mac beta (1.13). Please use the stable channel of Docker for Mac https://docs.docker.com/docker-for-mac/ # ionotify for Sublime users If you use Sublime, please checkout the plugin by Yves to help with auto reloads on file changes - https://github.com/yvess/sublime_d4m
Enter the window of mounting directory through the command
screen -r d4m
If you see the following mount items, the mount is successful
192.168.65.1:/Users/Lavekin /mnt nfs nolock,local_lock=all 0 0 192.168.65.1:/Users /Users nfs nolock,local_lock=all 0 0 192.168.65.1:/Volumes /Volumes nfs nolock,local_lock=all 0 0 192.168.65.1:/private /private nfs nolock,local_lock=all 0 0
docker-compose up -d nginx redis mysql Creating network "laradock_default" with the default driver Creating laradock_redis_1 Creating laradock_applications_1 Creating laradock_mysql_1 Creating laradock_workspace_1 Creating laradock_php-fpm_1 Creating laradock_nginx_1
See the above running log Congratulations on running the container and mounting it locally