Docker under LAMP environment Deployment!!!

Source: Internet
Author: User
Tags docker run

Project background:

In our web project development process, software testing environment, project on-line environment we often need to build the lamp environment, you may not want each application scenario to build a lamp environment, this time we can use Docker (container) to liberate us from the cumbersome environment, Let's be more inclined to the business itself.



Lab Environment:

VMware Workstation 11

Under the centos7.0 system

Server: ip:192.168.0.33

SECURECRT (SSH remote connection software)

Docker-1.8.2-10.el7.centos.x86_64



Software Introduction:

Here are two things I know about Docker.

http://9399369.blog.51cto.com/9389369/1758576 "Docker Concise Tutorial One"

http://9399369.blog.51cto.com/9389369/1758752 "Docker Brief Tutorial II"






Key points are:

Docker search-s lamp #这是我们常用的docker搜索镜像的命令, meaning: search for more than 10 star lamp mirror! The higher the number of stars, the more people download.

Docker pull Docker.io/reinblau/lamp #下载docker. Io/reinblau the lamp image of the registered server.

Docker run-d-P 8888:80 docker.io/reinblau/lamp #以守护进程的方式启动启动镜像, and do port mapping

Curl http://127.0.0.1:8888 #访问本地的8888端口 to access the Web server inside the container.





Experimental process:

First, Software Installation:

I chose the CENTOS7 system because it was better for Docker support.

1, first check whether the system is already installed Docker, the default is not installed

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7E/6A/wKiom1b-Mn2Ri9msAADDRu8AlQI939.png "title=" Check to see if Docker.png "alt=" Wkiom1b-mn2ri9msaaddru8alqi939.png "is installed/>

2. Install with the Yum source from CentOS (because Docker is already included)

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/66/wKioL1b-M7eSALPEAACg1vvSByE312.png "title=" Docker install. png "alt=" Wkiol1b-m7esalpeaacg1vvsbye312.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/66/wKioL1b-NCiy7U2-AAEyeuMdrHc756.png "title=" Docker installation 2.png "alt=" Wkiol1b-nciy7u2-aaeyeumdrhc756.png "/> Second, lamp image installation

1. The Docker service will need to be started after Docker installation before the Docker command can be used.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7E/6A/wKiom1b-NGrgJw2-AAA53INlaMM385.png "title=" The Docker service starts the. png "alt=" Wkiom1b-ngrgjw2-aaa53inlamm385.png "/>

Now that our Docker service has started, we can use the Docker commands properly!

2, search for 10 stars of the lamp mirror resources

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7E/6A/wKiom1b-NSKz6eA9AABGqh1k3f8796.png "title=" Mirror search. png "alt=" Wkiom1b-nskz6ea9aabgqh1k3f8796.png "/>3, installing Lamo mirroring

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/6A/wKiom1b-Ng7gKN9uAACSORqNR0k588.png "title=" Image installation 1.png "alt=" Wkiom1b-ng7gkn9uaacsorqnr0k588.png "/>650) this.width=650; src=" http://s5.51cto.com/wyfs02/M01 /7e/6a/wkiom1b-ntnquo8baafzu7t4fno152.png "title=" image download 2.png "alt=" Wkiom1b-ntnquo8baafzu7t4fno152.png "/>4, Test: View the images we have installed

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7E/6A/wKiom1b-N4fAs0AyAABFqPTVHw8920.png "title=" View the installed image. png "alt=" Wkiom1b-n4fas0ayaabfqptvhw8920.png "/>

Third, start lamp container

1. Start a container with the image we just downloaded

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7E/6A/wKiom1b-OOqwSeoDAAB09p0CA-s431.png "title=" Start and view Docker.png "alt=" Wkiom1b-ooqwseodaab09p0ca-s431.png "/>2, test: Log in to the Web site in the container

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7E/66/wKioL1b-On_jMxmXAACToisbWdA338.png "title=" Test the Web site. png "alt=" Wkiol1b-on_jmxmxaactoisbwda338.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7E/67/wKioL1b-OwqgUfZfAAEX-kwGbes392.png "title=" Test 2.png "alt=" Wkiol1b-owqgufzfaaex-kwgbes392.png "/>

Can see the successful return of an HTML file!!!!




Project implementation Summary: Through the Docker image we can save time, effort, worry to meet our business needs. More flexible.

Hope we all have the income!!! Thank you. If you do not understand, you can leave me a message below.




This article is from the "Make a few" blog, be sure to keep this source http://9399369.blog.51cto.com/9389369/1759300

Docker under LAMP environment Deployment!!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.