Docker deploy LAMP project

Foreword

Before we learn how to deploy LAMP project in Linux, today we have to learn about how to deploy LAMP key projects under the Docker it!

Docker system requirements CentOS kernel version higher than 3.10, see this page prerequisite to verify your CentOS version supports Docker. By uname -r to see your current kernel version command

1. Install docker, enter the command: curl -fsSL https://get.docker.com/ | SH

2. Start docker, enter the command: systemctl Start Docker

3. Verify installation docker: docker Version, the installation is successful the following screen appears:

4. Add the average user at docker, enter the command: useradd tester

5. Add User Group: sudo groupadd docker

6.root user to alter the user permissions tester, chmod u + w / etc / sudoers

7.vi /etc/sudoers   :set number   92行

testing All = (ALL) ALL yy root copy the line below the line as a behavior modification 51testing All = (ALL) ALL as shown in FIG.

 

Modify good switching press the ESC key switch to the command line, enter: wq save out

8. Enter su tester switch to normal users

9. The user is added to the testing group docker: the sudo docker testing the usermod -G

10. Exit 51testing ordinary user, log in 51testing again,

docker version

/ * Difficulties mirror, you can modify the configuration file to visit the country mirror sites

(1)在root用户下添加/etc/docker/daemon.json文件

{ "registry-mirrors":["https://help.aliyun.com/document_detail/60750.html","http://hub-mirror.c.163.com"]

}

(2)在root用户下赋予权限 chmod 755 /etc/docker/daemon.json

(3)重启服务器: # systemctl daemon-reload

 # systemctl restart docker*/

切换root用户

1、docker pull nickistre/centos-lamp

2、拷贝并解压iwebshop电子商城压缩包到/root/mylamp

3、如果有写权限问题的要用chmod –R 777 upload/来给upload文件夹以及底下的子目录授予写权限

4、docker run -d -p 8086:80 -v /root/mylamp:/var/www/html nickistre/centos-lamp

5、浏览器访问http://localhost:8086/iwebshop进行安装

Guess you like

Origin www.cnblogs.com/zhangwuxuan/p/12441548.html