美文网首页
Docker笔记:apache+php7.1安装实录

Docker笔记:apache+php7.1安装实录

作者: 棒打耗子v5 | 来源:发表于2018-12-06 19:20 被阅读0次

    环境“centos7”

    以下是所有命令,一步一步执行:

    1、sudo docker pull centos/httpd

    2、sudo docker run --name httpd-fbmall -d --restart always -p 8088:80 -p 8089:443 -v  /opt/docker/wwwroot/fbmall:/var/www/html -v /opt/docker/httpd/logs:/etc/httpd/logs centos/httpd

    3、sudo docker exec httpd-fbmall yum install -y epel-release

    4、sudo docker exec httpd-fbmall rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

    5、sudo docker exec httpd-fbmall yum update -y

    6、sudo docker exec httpd-fbmall yum install -y gcc make openssl openssl-devel

    //sudo docker exec httpd-fbmall yum install -y --enablerepo=remi  --enablerepo=remi-php71 php php-devel  php-mbstring php-mcrypt php-mysqlnd php-pdo php-gd

    7、sudo docker exec httpd-fbmall yum install -y --enablerepo=remi --enablerepo=remi-php71 php php-devel php-mbstring php-mcrypt php-mysqlnd php-pdo php-gd php-redis php-swoole php-zip php-xml

    8、sudo docker exec httpd-fbmall yum clean all

    9、sudo docker exec httpd-fbmall rm -rf /var/cache/yum

    10、sudo docker restart httpd-fbmall

    11、sudo docker stop httpd-fbmall   停止镜像

    12、sudo docker commit -m "centos httpd+php7.1 v2.0" httpd-fbmall httpd-php71:2.0 部署完成后,可以将容器创建为镜像,留待以后可以方便地创建httpd+php环境的容器。

    13、新建容器:sudo docker run --name httpd-fbmall -d --restart always -p 8088:80 -p 8089:443 -v  /opt/docker/wwwroot/fbmall:/var/www/html -v /opt/docker/httpd/logs:/etc/httpd/logs centos/httpd

    相关文章

      网友评论

          本文标题:Docker笔记:apache+php7.1安装实录

          本文链接:https://www.haomeiwen.com/subject/ljcacqtx.html