这里详细描述问题
从workerman官网下载的原生 gatewayworker
Dockerfile
FROM alpine:latest
#安装init
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk update \
&& apk add git wget curl nload php8-cli php8-redis php8-pcntl php8-posix php8-iconv php8-pdo php8-gd php8-pdo_mysql \
php8-pecl-event php8-curl php8-json php8-xml php8-openssl php8-mysqli php8-common php8-ctype php8-phar php8-mbstring php8-bcmath \
&& php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& php composer.phar config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
&& ln -s /app/composer.phar /usr/bin/composer
WORKDIR /app
#COPY / /app
RUN mkdir -p /tmp/logs \
&& mkdir -p /tmp/sessions \
&& mkdir -p /tmp/views \
&& rm -rf /app/runtime \
&& ln -s /tmp /app/runtime
#暴露 http 与 websocket_attach
EXPOSE 1238 2346 2900 2901 2902 2903
VOLUME /app
# DockerSocket
VOLUME /var/run/docker.sock
CMD ["php","/app/start.php","start"]
EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
PHP Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195PHP Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195PHP Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195PHP Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
Warning: EventBase::loop(): Failed to invoke event callback, breaking the loop. in /app/vendor/workerman/workerman/Events/Event.php on line 195
Workerman[start.php] has been stopped
alpine linux container
php --ri event ,看下event扩展版本
报错里看不出什么问题,可以把event升级到3.0.8试下
先留着吧,我想其他用docker的并且也是用官方的alpine镜像的也会来这里看看的
升级到了3.0.8也是一样会出现, Ubuntu20,PHP8.1 之前使用PHP7.4是没有出现
大佬,我突然想起来,这个错误 仅仅在 ctrl+c 结束进程时(非 -d 进程守护) 模式下 的错误,好像没有任何影响,但是就是结束进程的时候发生的错误
https://github.com/mouyong/docker-environment/blob/master/php/Dockerfile 可作为 webman、webman gatewayworker 开发与线上部署的容器
和我的Dockerfile安装方式没有任何区别,我是alpine linux,你这个不也是 直接用的官方包管理器安装的,没啥用。只不过是换了个操作系统换了个包管理器,本质问题还是没有解决,
ps: 我使用alpine linux 镜像包构建完毕后20Mb,你看看是否能压缩到这个大小