Littlesqx / aint-queue

:rocket: An async-queue library built on top of swoole, flexable multi-consumer, coroutine supported. 基于 Swoole 的一个异步队列库,可弹性伸缩的工作进程池,工作进程协程支持。
MIT License
178 stars 32 forks source link

没有swoole环境时候是否可以入队列操作? #39

Open mredencom opened 4 years ago

mredencom commented 4 years ago

如题

Littlesqx commented 4 years ago

可以;实例化(然后序列化)的代码不会运行就不会报错,反序列化才执行的环境(消费者)才需要 swoole 环境

mredencom commented 4 years ago

好的。老板您哪一个dockerfile什么时候可以修改好?

------------------ 原始邮件 ------------------ 发件人: "notifications"<notifications@github.com>; 发送时间: 2020年11月2日(星期一) 上午9:35 收件人: "Littlesqx/aint-queue"<aint-queue@noreply.github.com>; 抄送: "Mreden"<913057891@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [Littlesqx/aint-queue] 没有swoole环境时候是否可以入队列操作? (#39)

可以;实例化(然后序列化)的代码不会运行就不会报错,反序列化才执行的环境(消费者)才需要 swoole 环境

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Littlesqx commented 4 years ago

😂 ,我贴一下给你,紧急需要的话,你可以先试试:

FROM php:7.4.6-cli

COPY ./ /var/www/

RUN \
    php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" && \
    php composer-setup.php && \
    php -r "unlink('composer-setup.php');" && \
    mv composer.phar /usr/bin/composer && chmod +x "/usr/bin/composer"

RUN \
    apt install apt-transport-https ca-certificates && \
    echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free\n \
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free\n \
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free\n \
    deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free\n" > /etc/apt/sources.list

RUN \
    apt-get update              && \
    apt-get install -y             \
        libssl-dev                 \
        unzip                      \
        zlib1g-dev                 \
        --no-install-recommends && \
    rm -rf /var/lib/apt/lists/* /usr/bin/qemu-*-static

RUN \
    chmod +x /var/www/scripts/*.sh && \
    /var/www/scripts/install-swoole.sh 4.5.2

RUN composer install --no-dev

ENTRYPOINT ["./vendor/bin/aint-queue"]

WORKDIR "/var/www/"
mredencom commented 4 years ago

容器启动不了// 这个是我这边当前的Dockerfile

FROM php:7.4.6-cli

COPY ./ /var/www/

RUN \     php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" && \     php composer-setup.php && \     php -r "unlink('composer-setup.php');" && \     mv composer.phar /usr/bin/composer && chmod +x "/usr/bin/composer"

RUN \     apt install apt-transport-https ca-certificates && \     echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free\n \     deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free\n \     deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free\n \     deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free\n" > /etc/apt/sources.list

RUN \     apt-get update              && \     apt-get install -y             \         libssl-dev                 \         unzip                      \         zlib1g-dev                 \         --no-install-recommends && \     rm -rf /var/lib/apt/lists/ /usr/bin/qemu--static

RUN \     chmod +x /var/www/scripts/*.sh && \     /var/www/scripts/install-swoole.sh 4.5.2

RUN composer install --no-dev

RUN  cd /var/www/ \     && composer install --no-dev \     && composer clearcache EXPOSE 9501

ENTRYPOINT ["./vendor/bin/aint-queue"]

WORKDIR "/var/www/"

------------------ 原始邮件 ------------------ 发件人: "notifications"<notifications@github.com>; 发送时间: 2020年11月2日(星期一) 上午9:44 收件人: "Littlesqx/aint-queue"<aint-queue@noreply.github.com>; 抄送: "Mreden"<913057891@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [Littlesqx/aint-queue] 没有swoole环境时候是否可以入队列操作? (#39)

😂 ,我贴一下给你,紧急需要的话,你可以先试试: FROM php:7.4.6-cli COPY ./ /var/www/ RUN \ php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" && \ php composer-setup.php && \ php -r "unlink('composer-setup.php');" && \ mv composer.phar /usr/bin/composer && chmod +x "/usr/bin/composer" RUN \ apt install apt-transport-https ca-certificates && \ echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free\n \ deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free\n \ deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free\n \ deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free\n" > /etc/apt/sources.list RUN \ apt-get update && \ apt-get install -y \ libssl-dev \ unzip \ zlib1g-dev \ --no-install-recommends && \ rm -rf /var/lib/apt/lists/ /usr/bin/qemu--static RUN \ chmod +x /var/www/scripts/*.sh && \ /var/www/scripts/install-swoole.sh 4.5.2 RUN composer install --no-dev ENTRYPOINT ["./vendor/bin/aint-queue"] WORKDIR "/var/www/"
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mredencom commented 4 years ago

我这边包安装成功了,Installing littlesqx/aint-queue (v1.2.2): Extracting archive 但是总是报错我的目录不存在 docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"./vendor/bin/aint-queue\": stat ./vendor/bin/aint-queue: no such file or directory": unknown.

Littlesqx commented 4 years ago

试了下,可以成功,你这边打包过程应该成功吧

mredencom commented 4 years ago

试了下,可以成功,你这边打包过程应该成功吧

我这边打包了不下10次可以成功,但是docker run 的时候成功不了。。。。,希望可以给出完整一份教程,感谢!