Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

建议建立一个基础的docker 镜像 #86

Closed
dream-mind opened this issue Jul 17, 2019 · 5 comments · Fixed by #200
Closed

建议建立一个基础的docker 镜像 #86

dream-mind opened this issue Jul 17, 2019 · 5 comments · Fixed by #200

Comments

@dream-mind
Copy link

建议 建立一个基于 alpine-nginx-php7 的docker image,可以向java 版学习

@heyanlong
Copy link
Member

意见已采纳

@sinbad01234
Copy link

sinbad01234 commented Jul 20, 2019

FROM php:7.2-fpm
MAINTAINER sinbad "sinbad"
ENV REFRESHED_AT 2019-04-21 10:10:10
ENV INSTALL_LIB_DEP="wget zip unzip"
RUN apt-get update
RUN apt-get install -y $INSTALL_LIB_DEP
RUN apt-get install -y -q git rake ruby-ronn zlib1g-dev libcurl4-openssl-dev && apt-get clean

RUN cd /usr/local/bin && curl -sS https://getcomposer.org/installer | php
RUN cd /usr/local/bin && mv composer.phar composer

RUN pecl install grpc

#install protoc
RUN mkdir -p /tmp/protoc &&
curl -L https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip > /tmp/protoc/protoc.zip &&
cd /tmp/protoc &&
unzip protoc.zip &&
cp /tmp/protoc/bin/protoc /usr/local/bin &&
cd /tmp &&
rm -r /tmp/protoc &&
docker-php-ext-enable grpc

RUN set -ex
&& cd /opt
&& wget https://github.com/SkyAPM/SkyAPM-php-sdk/archive/master.zip -O SkyAPM.zip
&& unzip SkyAPM.zip
&& cd SkyAPM-php-sdk-master
&& phpize
&& ./configure
&& make && make install
&& wget https://github.com/SkyAPM/SkyAPM-php-sdk/releases/download/3.1.2/sky_php_agent_linux_x64
&& mv sky_php_agent_linux_x64 report_client
&& chmod +x report_client
&& cp report_client /usr/bin/

RUN apt-get install libssl-dev -y
&& rm -rf /tmp/pear

RUN apt-get update -y &&
apt-get install -y libmcrypt-dev &&
pecl install mcrypt-1.0.1 &&
docker-php-ext-enable mcrypt

RUN set -ex
&& apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
&& docker-php-ext-install -j$(nproc) gd
&& docker-php-ext-install mysqli
&& docker-php-ext-install zip
&& docker-php-ext-install pdo
&& docker-php-ext-install pdo_mysql
&& docker-php-ext-install opcache

RUN apt-get remove -y $INSTALL_LIB_DEP && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install sockets
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
WORKDIR /code
RUN chmod 777 /code
RUN chmod 777 /usr/bin/report_client
RUN usermod -u 1000 www-data
CMD ["php-fpm"]

@sinbad01234
Copy link

建议 建立一个基于 alpine-nginx-php7 的docker image,可以向java 版学习
把镜像FROM 改成这个 alpine-nginx-php7 试下,我用的是php:7.2-fpm

@heyanlong
Copy link
Member

heyanlong commented Jul 21, 2019 via email

@heyanlong heyanlong reopened this Jul 22, 2019
@DavenAaron
Copy link

三楼 dockerfile 应该是存在问题的
FROM php:7.2-fpm 为zts版本的php-fpm

heyanlong added a commit that referenced this issue Mar 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants