php7 安装yar 生成docker镜像
Docker  /  管理员 发布于 4年前   343
Docker包含三个概念: (1)远程仓库即远程镜像库所有镜像的聚集地(不可进入操作)。 (2)本地镜像即从远程仓库拉取过来的镜像 (3)运行起来的本地镜像叫做容器(分层的可操作) Docker使用: 1.首先通过第三方镜像库(c.163.com)拉取相应的信息比如centos,ubuntu,tomcat等作为基础镜像。 Docker pull xxxx 2.运行下载好的镜像。 Docker run -dt -p 宿主机端口:镜像端口 --name起一个名字 镜像id/镜像名字 bash -d 后台运行 3.进入容器有两种方法 (1)docker exec -it容器名字/容器id bash(ctrl+d退出时不会停止该运行的容器) (2)Docker attach 容器名字/容器id (ctrl+d退出时会停止该运行的容器) 4.开始下载编译环境所需的相应的工具和所需的依赖包 (1)yum安装wget以及编译的工具 yum install -y wget gcc gcc-c++ make openssl-devel (2)更新国内yum源 (3)下载各个版本的nginx版本 (4)下载pcre ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/xxx Xxx表示选择的版本 (5)更新yum确保最新的 Yum update (6)下载php7 http://php.net/downloads.php 选择版本,选择国界 (7)把以上下载的东西全部粘贴到/usr/local/src 并且全部解压 (8)编译nginx (1)创建nginx用户 (2)编译安装nginx (9)编译php (1)准备php的依赖包 (2)进入php文件目录 (3)开始编译php 注:出现问题自行百度。 (4)make && make install (5)准备php配置文件 (6)修改配置文件 ;daemonize = yes的注释去掉,并把yes改为no (7)安装yar拓展 (1)安装二进制打包协议msgpack 注:出现问题自行百度 (2)下载yar wget http://pecl.php.net/get/xxx Xxx表示版本 确定好与php版本对照这个很重要。 (3)解压编译tar -zxvf yar-2.0.0.tgz (4)cd cd yar-2.0.0 (5)/usr/bin/phpize (6)./configure --with-php-config=/usr/bin/php-config7.0* (7)make && make install (8)如果出现模块未安装可 php --ini 查看ini路径相对调整 (9)docker commit -m "描述" -a "作者" 容器id 仓库信息mydocker/nginx:版本信息v1 (10)docker save xxx > /home/save.tar (11)Docker load xxx 如果编译安装过程中报错,按照报错提示的去用yum解决依赖关系;如果当前的yum源解决不了,那么可以试试: 以上所述是小编给大家介绍的php7 安装yar 生成docker镜像,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对站的支持!
-t 生成一个伪终端
-p 指定端口
--name 为运行的容器起一个名字Wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/xxx/Xxx表示你要选择的yum源-O 下载并以不同的文件名保存CentOS-Base.repo 表示命名的yum源
Wget http://nginx.org/download/xxxXxx表示你要选择的nginx的版本
groupadd -r nginxuseradd -r -g nginx nginx
cd xxx 切换到您的nginx目录./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-pcre=/usr/local/src/pcre-8.37./configure参数说明:--prefix=指定文件的安装目录--user=指定用户--group指定用户组--with-使用已有的软件包和库文件Make && make install 出现问题自行百度echo "daemon off;" >> /usr/local/nginx/conf/nginx.conf #在nginx的配置文件里加上这一行很关键,这样nginx可以在docker启动的时候在后台运行!
yum install -y bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel
./configure --prefix=/usr/local/php --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr/local/libxml --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr/local/libjpeg --with-png-dir=/usr/local/libpng --enable-gd-native-ttf --with-openssl --with-fpm-user=www --with-fpm-group=www --with-libdir=lib64 --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm --enable-xml --enable-shmop --enable-session --enable-ctype --with-iconv-dir --with-iconv
cp php.ini-production /etc/php.inicd /usr/local/php/etccp php-fpm.conf.default php-fpm.conf
find / -name phpize 查找phpize是否存在yum install php-devel pecl install msgpack
wget http://www.atomicorp.com/installers/atomic chmod +x atomic ./atomic yum install -y XXX XXX
您可能感兴趣的文章:
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号