PHP7 installing Yar creating a docker image

Source: Internet
Author: User
Tags imap mcrypt docker run
This article mainly describes the PHP7 installation Yar generated Docker image, the need for friends can refer to the following

Docker consists of three concepts:

(1) The remote Repository is the aggregate of all the mirrors in the Remote Mirror Library (no entry operation).

(2) The local image is the image pulled from the remote repository.

(3) A local image is called a container (layered and operable).

Docker use:

1. First use the third-party Image Library (c.163.com) to pull the corresponding information such as CENTOS,UBUNTU,TOMCAT, etc. as the base image.

Docker pull xxxx

2. Run the downloaded image.

Docker run-dt-p host Port: Mirror Port--name a name Mirror ID/image name bash

-D Background Run
-T generates a pseudo terminal
-P Specify port
--name a name for the running container

3. There are two ways to enter the container

(1) Docker exec-it container name/container ID bash (Ctrl+d does not stop the running container when exiting)

(2) Docker attach container name/container ID (Ctrl+d will stop the running container when exiting)

4. Start downloading the appropriate tools and dependent packages required to compile the environment

(1) Yum installation wget and compiled tools Yum install-y wget gcc 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 says you want to choose the Yum Source-O Download and save with a different file name Centos-base.repo represents a named Yum source

(3) Download the Nginx version of each version

Wget Http://nginx.org/download/xxxXxx represents the version of Nginx 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, select a border

(7) Paste all the above downloaded items into/usr/local/src and unzip them all.

(8) Compile Nginx

(1) Create Nginx user

Groupadd-r Nginxuseradd-r-G nginx

(2) Compile and install Nginx

CD XXX switch 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= the installation directory of the specified file--user= Specifies that the user--group the specified user group--with-use the existing software package and library file make && make install problem self Baidu echo "daemon off;" >>/usr/local/nginx/ conf/nginx.conf #在nginx的配置文件里加上这一行很关键 so nginx can run in the background when Docker boots!

(9) Compiling PHP

(1) Preparing a PHP dependency package

Yum install-y Bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel libxml2-devel libcurl-devel bzip2-devel Rea Dline-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: There is a problem self-Baidu.

(4) Make && make install

(5) Preparing 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

;d aemonize = yes to remove the comment and change yes to No

(7) Installation Yar expansion

(1) Install Binary Package protocol Msgpack

Find/-name phpize look for phpize if there is a Yum install php-devel pecl install Msgpack

Note: Problems arise self-Baidu

(2) Download Yar wget http://pecl.php.net/get/xxx

XXX indicates that the version is OK with the PHP version of this is very important.

(3) Unzip the compiled 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) If the module is not installed can php--ini view ini path relative adjustment

(9) Docker commit-m "description"--"author" container ID Warehouse Information Mydocker/nginx: Version information v1

(ten) Docker save xxx >/home/save.tar

(one) Docker load xxx

If the compilation of errors in the installation process, according to the error prompts to use Yum to resolve the dependency relationship, if the current Yum source can not solve, then try:

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

Related Article

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.