飞嗨,欢迎您的光临,本博所发布之文章皆为作者亲测通过,如有错误,欢迎通过各种方式指正。(本博已于2015.12.6升级到php7,运行环境php7 php-fpm + nginx1.8.0)

最新lnmp docker容器(CentOS7,Nginx1.10.0,MySQL5.7,PHP7.0.2)

Linux lf 11037℃ 0评论

真是心累,前些天mac book pro进水了,现在拿出大学时用的lenovo idepad Y450老本本用,真是欲哭无泪!每当mysq编译到30%左右的时候就发烫自动关机了!就这,还是用的ubuntu系统…我的mac买了半年还没到,拿去apple零售店让我换一块主板4k多+一块电池3k多,共8k多的维修费,没舍得修!太贵了!老本本真是太难用了,mysql编译真的要很久很久很久都编译不完,哎!!!

ubuntu环境 && 安装docker

ubuntu 16.04

ubuntu 16.04

编写Dockerfile生成image

Dockerfile && docker build

Dockerfile && docker build

Dockerfile:

FROM centos:7
MAINTAINER liufee job@feehi.com
RUN yum -y install epel-release && yum -y update
RUN yum -y install pcre pcre-devel zlib zlib-devel openssl openssl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel curl curl-devel freetype freetype-devel libmcrypt libmcrypt-devel cmake gcc-c++ ncurses-devel perl-Data-Dumper autoconf wget libicu libicu-devel libmcrypt libmcrypt-devel vim

ADD /nginx-1.10.0 /downloads/nginx-1.10.0
WORKDIR /downloads/nginx-1.10.0
RUN ./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/tmp/nginx/client/ --http-proxy-temp-path=/tmp/nginx/proxy/ --http-fastcgi-temp-path=/tmp/nginx/fcgi/ --with-pcre --with-http_dav_module 
RUN make && make install

ADD /php-7.0.6 /downloads/php-7.0.6
WORKDIR /downloads/php-7.0.6
RUN ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-soap --enable-mbstring=all --enable-sockets --enable-fpm --with-gd --with-freetype-dir=/usr/include/freetype2/freetype --with-jpeg-dir=/usr/lib64 --with-zlib --with-iconv --enable-libxml --enable-xml --with-curl --with-mcrypt --with-openssl --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-intl
RUN make && make install

ADD /mysql-5.7.12 /downloads/mysql-5.7.12
WORKDIR /downloads/mysql-5.7.12
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=/downloads/mysql-5.7.12/boost
RUN make
RUN make install
RUN mkdir -p /data/mysql
RUN useradd mysql
RUN chown -R mysql /data/mysql
RUN /usr/local/mysql/bin/mysqld --initialize --initialize-insecure --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql


ADD /etc /etc
ADD /nginx /etc/init.d/nginx
RUN chmod +x /etc/init.d/nginx
RUN useradd nginx
RUN mkdir -p /tmp/nginx/client
RUN cp /downloads/php-7.0.6/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm && chmod +x /etc/init.d/php-fpm
RUN cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
RUN cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
RUN cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld && chmod +x /etc/init.d/mysqld

ADD /start.sh /start.sh
RUN chmod +x /start.sh
CMD ["/start.sh"]

运行docker build -t feehi/lnmp:v3 .  (不要省略.,代表Dockerfile所在目录,.代表当前目录

因为使用ADD远程文件的时候格外慢,我下载了最新版的nginx1.10.0 php-7.0.6 mysql-5.7到本地了,下载完后解压/解包放到与Dockerfile同级目录,mysql下载带boost的版本

docker

docker

然后就是等待过程,可怜我的老本本,总是编译mysql到30%多的时候发烫死机!!!

docker build finished

docker build finished

运行docker容器

feehi/lnmp:v3

feehi/lnmp:v3

docker run -t -i feehi/lnmp:v3 /bin/bash进入到交互模式

查看mysql php nginx版本

mysql5.7 php7 nginx1.10

mysql5.7 php7 nginx1.10

在运行容器的时候,已经暴露80端口给外部了,访问http://127.0.0.1/,最新版lnmp环境已经正常了

最新lnmp

最新lnmp

所需文件拷贝>>>http://github.com/liufee/docker

转载请注明:飞嗨 » 最新lnmp docker容器(CentOS7,Nginx1.10.0,MySQL5.7,PHP7.0.2)

喜欢 (8)or分享 (0)
发表我的评论
取消评论
表情
(25)个小伙伴在吐槽
  1. Purchase Cheap Priligy http://abuycialisb.com - Cialis Cialis En Ligne Pas Chere Buy Cialis Does Cephalexin Come In 875mg?
    匿名2020-02-23 05:27 (13小时前)回复
  2. Bom artigo para todos que querem aprender a cantar rapidamente e de maneira simples.. Aprender as técnicas de canto é totalmente necessário para quem quer aprender a desenvolver a sua técnica de canto, quem ama cantar deve procurar esse caminho. É por isso que estou indicando esse conteúdo muito interessante e bem útil para quem quer aprender a cantar veja. como cantar bonito.
    匿名2020-02-17 06:28 (6天前)回复
  3. Ler para encontrar informações de marketing detalhadas que irão ajudá-lo a se conectar facilmente com seus clientes.
    匿名2020-02-17 00:29 (7天前)回复
  4. Propecia Preiswert http://viacialisns.com/# - cialis without a doctor's prescription Cialis Spedizione Contrassegno Buy Cialis Buy Propecia In Canada
    匿名2020-02-16 20:51 (7天前)回复
  5. Priligy Para Que Sirve http://abcialisnews.com - Cialis Trimohills Buy Cialis Propecia Online Pharmacy
    匿名2020-02-11 14:57 回复
  6. Anastrozole Benefits For Men http://buycialisuss.com - cialis without a doctor's prescription Order Fluexotine Online cialis without prescription Kamagra Wikipedia
    匿名2020-02-09 20:03 回复
  7. Will Keflex Treat Gonorrhea http://apcialisle.com/# - Cialis Strattera Online Uk Scam cialis price Viagra Rezeptfrei Kaufen Billig
    匿名2020-02-04 11:53 回复
  8. Forum Cialis Viagra http://cheapcialisir.com - generic cialis canada Viagra 100 Roma cialis 5 mg Cialis 5 Mg Foro
    匿名2020-02-04 06:06 回复
  9. Finasteride 1mg Generic Propecia http://cialibuy.com/#341 - Buy Cialis Propecia Success Story п»їcialis Keflex For Tooth Ache
    匿名2020-02-02 09:09 回复
  10. 39 Vigara http://apcialisle.com/#863 - cheapest cialis Tadalafil 20 Mg Softgel order cialis online Viagra Without A Presabana
    匿名2020-02-02 03:58 回复
  11. where to order direct isotretinoin 10mg tablets http://viacialisns.com - Buy Cialis Online Medz where to buy cialis online safely Cephalexin For Animal
    匿名2020-01-30 07:17 回复
  12. Citalopram Pills For Sale http://cialisjh.com - Cialis Cialis 20mg Holland Cialis Amoxicillin Dry Throat
    匿名2020-01-30 06:36 回复
  13. How To Buy Viagra Online From Canada http://buycialisuss.com - Buy Cialis 1mg Finasteride Side Effects Propecia Cialis Donde Puedo Comprar Pastillas Cytotec
    匿名2020-01-30 05:40 回复
  14. Buy Amoxicillin Without A Prescription http://cialisjh.com - Buy Cialis Levitra Acheter En Baisse Buy Cialis Buy Sperm Count Online
    匿名2020-01-29 16:37 回复
  15. Acheter Levitra En Ligne http://cialisjh.com - Cialis Amoxicillin Dosage For Cats canadian cialis Viagra Likor Rezept
    匿名2020-01-27 16:42 回复
  16. Priligy Efectos Secundarios http://cialibuy.com - cialis 40 mg Lisinopril For Sale cialis tablets for sale Buying free shipping isotretinoin isotrex best website
    匿名2020-01-26 03:04 回复
  17. Amoxicillin Dosage For Strep http://cialibuy.com - online cialis Can I Get Cymbalta In Mexico Buy Cialis Isotretinoin Isotretin Best Website
    匿名2020-01-23 16:38 回复
  18. Cheapest Cialis India http://cialibuy.com - Cialis Mega Hoodia Buy Cialis Cheap Discount Tadalis Sx
    匿名2020-01-20 23:22 回复
  19. Pilule Cialis http://cialibuy.com - Cialis Cialis 5 Mg Cost Buy Cialis Can I Take My Childs Amoxicillin
    匿名2020-01-20 22:15 回复
  20. Buy Generic Levitra http://cialibuy.com - Buy Cialis Over The Counter Medicine For Uti cialis 40 mg Kamagra Para Ellas
    匿名2020-01-20 17:37 回复
  21. England Study Gonerrhea Amoxicillin 40 Viagra Pills For 99.00 Buy Cialis Zenegra 100 Mg Reviews Cialis Fast
    匿名2020-01-17 14:59 回复
  22. 54456546
    匿名2018-09-11 13:12 回复
  23. 【在运行容器的时候,已经暴露80端口给外部了,访问http://127.0.0.1/,最新版lnmp环境已经正常了】请问你这里写的运行容器的时候是指的是运行centos这个镜像 还是指的是运行feehi/lnmp:v3 这个镜像。我运行feehi/lnmp:v3 外界并访问不了
    匿名2017-04-29 22:31 回复
  24. 年中快乐!
    5297284372016-06-17 08:55 回复
    • 一起快乐,哈哈
      lf2016-10-26 16:08 回复
粤ICP备15018643号-1