這里詳細(xì)描述問(wèn)題
從workerman官網(wǎng)下載的原生 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擴(kuò)展版本
/app # php --ri event
event
Event support => enabled
Sockets support => enabled
Debug support => disabled
Extra functionality support including HTTP, DNS, and RPC => enabled
OpenSSL support => enabled
Thread safety support => disabled
Extension version => 3.0.7
libevent2 headers version => 2.1.12-stable
大佬,我突然想起來(lái),這個(gè)錯(cuò)誤 僅僅在 ctrl+c 結(jié)束進(jìn)程時(shí)(非 -d 進(jìn)程守護(hù)) 模式下 的錯(cuò)誤,好像沒(méi)有任何影響,但是就是結(jié)束進(jìn)程的時(shí)候發(fā)生的錯(cuò)誤
https://github.com/mouyong/docker-environment/blob/master/php/Dockerfile 可作為 webman、webman gatewayworker 開(kāi)發(fā)與線上部署的容器
和我的Dockerfile安裝方式?jīng)]有任何區(qū)別,我是alpine linux,你這個(gè)不也是 直接用的官方包管理器安裝的,沒(méi)啥用。只不過(guò)是換了個(gè)操作系統(tǒng)換了個(gè)包管理器,本質(zhì)問(wèn)題還是沒(méi)有解決,
ps: 我使用alpine linux 鏡像包構(gòu)建完畢后20Mb,你看看是否能壓縮到這個(gè)大小