Install yar in php7 to generate a docker image, yardocker

Source: Internet
Author: User
Tags imap mcrypt

Install yar in php7 to generate a docker image, yardocker

Docker contains three concepts:

(1) Remote repository is the gathering place of all images in the remote image repository (you cannot enter the operation ).

(2) Local images are images pulled from remote warehouses.

(3) A running local image is called a container (stratified operation)

Docker usage:

1. First, use a third-party Image Library (c.163.com) to pull the relevant information, such as centos, ubuntu, and tomcat, as the basic image.

Docker pull xxxx

2. Run the downloaded image.

Docker run-dt-p host port: Image Port -- name indicates a name image id/image name bash

-D running in the background
-T generate a Pseudo Terminal
-P: specified port
-- Name indicates the name of the running container.

3. There are two ways to enter the container:

(1) docker exec-it container name/container id bash (the running container will not be stopped when ctrl + d exits)

(2) Docker attach container name/container id (the running container will be stopped when ctrl + d exits)

4. Start to download the corresponding tools and dependent packages required for the compiling environment.

(1) yum install wget and the compiled tool yum install-y wget gcc-c ++ make openssl-devel

(2) Update the domestic yum Source

Wget-O/etc/yum. repos. d/CentOS-Base.repo http://mirrors.aliyun.com/repo/xxx/xxx the yumsource you want to select to download and save the yum source named by CentOS-Base.repo with different file names

(3) download the nginx version of each version

Wget http://nginx.org/download/xxxxxx the nginxversion you want to select

(4) download pcre

Ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/xxx

Xxx indicates the selected version

(5) Update yum to ensure the latest

Yum update

(6) download php7

Http://php.net/downloads.php

Select a version and a national border

(7) paste all the downloaded items to/usr/local/src and decompress them all.

(8) Compile nginx

(1) Create an nginx user

 groupadd -r nginxuseradd -r -g nginx nginx

(2) Compile and install nginx

Switch cd xxx to your nginx directory. /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 parameter description: -- prefix = specifies the installation directory of the file -- user = specifies the user -- group specifies the user group -- with-use the existing software package and library file Make & make install. Baidu echo "daemon off; ">>>/usr/local/nginx/conf/nginx. conf # It is critical to add this line to the nginx configuration file so that nginx can be run in the background at docker startup!

(9) Compile php

(1) Prepare the php dependency package

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 

(2) enter the PHP file directory

(3) start compiling php

./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

Note: if any problem occurs, Baidu.

(4) make & make install

(5) Prepare the php configuration file

cp php.ini-production /etc/php.inicd /usr/local/php/etccp php-fpm.conf.default php-fpm.conf

(6) modify the configuration file

; Remove the daemonize = yes comment and change yes to no

(7) install yar Extension

(1) install the binary packaging protocol msgpack

Find/-name phpize check whether phpize exists yum install php-devel pecl install msgpack

Note: Baidu

(2) download yar wget http://pecl.php.net/get/xxx

Xxx indicates that it is important to confirm the version comparison with the php version.

(3) decompress and compile tar-zxvf yar-2.0.0.tgz

Cd yar-2.0.0 (4)

(5)/usr/bin/phpize

(6)./configure -- with-php-config =/usr/bin/php-config7.0 *

(7) make & make install

(8) If the module is not installed, check the ini path in php -- ini.

(9) docker commit-m "Description"-a "author" container id Repository Information mydocker/nginx: Version Information v1

(10) docker save xxx>/home/save.tar

(11) Docker load xxx

If an error is reported during compilation and installation, use yum to solve the dependency as prompted. If the current yum source cannot solve the problem, try:

 wget http://www.atomicorp.com/installers/atomic    chmod +x atomic    ./atomic     yum install -y XXX XXX

The above section describes how to install yar in php7 to generate a docker image. I hope it will be helpful to you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.