宸宸辉 潜水
  • 1发帖数
  • 1主题数
  • 0关注数
  • 0粉丝
开启左侧

构建php扩展swoole的运行情况docker镜像

[复制链接]
宸宸辉 发表于 2021-9-27 15:00:02 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
mkdir Dockerfilecd Dockerfile/touch dockerfilevi dockerfilei //插入dockerfile内容
FROM 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#install phpRUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpmRUN rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-8.rpmRUN yum install -y php74 php74-php php74-php-devel php74-php-bcmath php74-php-cli php74-php-common php74-php-gd php74-php-json php74-php-mbstring php74-php-xmlRUN rm -rf /usr/bin/php && ln -s /opt/remi/php74/root/usr/bin/php /usr/bin/php\    && rm -rf /usr/bin/phpize &&  ln -s /opt/remi/php74/root/usr/bin/phpize /usr/bin/phpize\    && rm -rf /usr/bin/php-config &&  ln -s /opt/remi/php74/root/usr/bin/php-config /usr/bin/php-config # composerRUN curl -sS https://getcomposer.org/installer | php \    && mv composer.phar /usr/bin/composer && chmod +x /usr/bin/composer# use aliyun composerRUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/CMD ["systemctl","restart","sshd"]#安装ssh服务RUN yum install -y openssh-serverRUN mkdir -p /var/run/sshdRUN 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" `php -i | grep php.ini |  awk -F "=>" '{print $2}' |grep php.ini` \    && rm -r swoole # DirVOLUME /workWORKDIR /work EXPOSE 9501 22Esc
:wq
构建镜像
docker build -t easyswoole -f dockerfile .查看easyswoole镜像
docker images启动一个easyswoole容器
docker run -itd --privileged \ --name=easyswoole -p 0.0.0.0:9502:9502 -v /work:/work \ easyswoole /usr/sbin/init查看easyswoole容器
docker ps
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

猜你喜欢
在线客服邮箱
wxcy#wkgb.net

邮箱地址#换为@

Powered by 创意电子 ©2018-现在 专注资源实战分享源码下载站联盟商城