自用swoole环境dockerfile
【摘要】 包含了基础的库,ssh 服务,composerFROM centos:8#version definedENV SWOOLE_VERSION 4.4.23#install libsRUN yum -y updateRUN yum install -y curl zip unzip wget openssl-devel gcc-c++ make autoconf git passwd#ins...
包含了基础的库,ssh 服务,composer
FROM centos:8
#version defined
ENV SWOOLE_VERSION 4.4.23
#install libs
RUN yum -y update
RUN yum install -y curl zip unzip wget openssl-devel gcc-c++ make autoconf git passwd
#install php
RUN yum install -y php-devel php-openssl php-mbstring php-json php-simplexml php-gd
# composer
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/bin/composer && chmod +x /usr/bin/composer
# use aliyun composer
RUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
CMD ["systemctl","restart","sshd"]
#安装ssh服务
RUN yum install -y openssh-server
RUN mkdir -p /var/run/sshd
RUN mkdir -p /root/.ssh
#取消pam限制
RUN sed -ri \
"s/session required pam_loginuid.so/#session required pam_loginuid.so/g" /etc/pam.d/sshd
RUN wget https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz \
&& mkdir -p swoole \
&& tar -xf swoole.tar.gz -C swoole --strip-components=1 \
&& rm swoole.tar.gz \
&& ( \
cd swoole \
&& phpize \
&& ./configure --enable-openssl \
&& make \
&& make install \
) \
&& sed -i "2i extension=swoole.so" /etc/php.ini \
&& rm -r swoole
# Dir
VOLUME /work
WORKDIR /work
EXPOSE 9501 22
复制
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)