tarampampam / laravel-roadrunner-in-docker

:rocket: An example of Laravel app that runs in a docker container with RoadRunner
MIT License
179 stars 35 forks source link

I got error when run this docker on windows, can this docker run on windows ? #79

Closed NguyenDinhKhoi closed 3 years ago

NguyenDinhKhoi commented 3 years ago

image

tarampampam commented 3 years ago

Hi @NguyenDinhKhoi!

What do you use as your environment? WSL, VirtualBox, or something else?

ps. I have no windows for the tests, Linux is my default OS for about seven years now...

NguyenDinhKhoi commented 3 years ago

Hi @tarampampam ! Thank you for replying, I install docker on the windows with WSL, and run it

tarampampam commented 3 years ago

Could you please provide more details? Your commands, full errors log, docker and docker-compose versions?

NguyenDinhKhoi commented 3 years ago

Docker: Docker version 20.10.8, build 3967b7d Docker-compose : docker-compose version 1.29.2, build 5becea4c

Errors log:

+ pecl install -o redis
ERROR: Service 'app' failed to build : The command '/bin/sh -c set -x     && apk add --no-cache         postgresql-libs         icu-libs     && apk add --no-cache --virtual .build-deps         postgresql-dev         autoconf         openssl         make         g++     && docker-php-ext-install -j$(nproc)         pdo_pgsql         sockets         opcache         pcntl         intl         1>/dev/null     && pecl install -o redis 1>/dev/null     && echo 'extension=redis.so' > ${PHP_INI_DIR}/conf.d/redis.ini     && wget -q "https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64"          -O /usr/bin/supercronic     && chmod +x /usr/bin/supercronic     && mkdir /etc/supercronic     && echo '*/1 * * * * php /app/artisan schedule:run' > /etc/supercronic/laravel     && openssl req -x509 -nodes -days 1095 -newkey rsa:2048         -subj "/C=CA/ST=QC/O=Company, Inc./CN=mydomain.com"         -addext "subjectAltName=DNS:mydomain.com"         -keyout /etc/ssl/private/selfsigned.key         -out /etc/ssl/certs/selfsigned.crt     && chmod 644 /etc/ssl/private/selfsigned.key     && docker-php-source delete     && apk del .build-deps     && rm -R /tmp/pear     && echo -e "\nopcache.enable=1\nopcache.enable_cli=1\nopcache.jit_buffer_size=32M\nopcache.jit=1235\n" >>         ${PHP_INI_DIR}/conf.d/docker-php-ext-opcache.ini     && php -m     && adduser         --disabled-password         --shell "/sbin/nologin"         --home "/nonexistent"         --no-create-home         --uid "10001"         --gecos ""         "appuser"     && mkdir /app /var/run/rr     && chown -R appuser:appuser /app /var/run/rr     && chmod -R 777 /var/run/rr' returned a non-zero code: 1
make: *** [Makefile:17: install] Error 1**

I have install "make" command and run directly on windows

tarampampam commented 3 years ago

It looks like a pecl issue... Can you replace the line:

https://github.com/tarampampam/laravel-roadrunner-in-docker/blob/33ea65db1abe2357903de11dfcc126001876fcb2/Dockerfile#L45

With

    && pecl install -o redis \

And show me the logs (all lines after the + pecl install -o redis in your logs) again?

NguyenDinhKhoi commented 3 years ago

I have created a virtual ubuntu machine and install 'pecl' and 'make' command then it works perfectly, thank for your support; In addition, can roadrunner run with multiversion php ?, i want to contain several projects with different php version in container ( php >=7.0 ). Is it possibe like virtual host in apache ?

tarampampam commented 3 years ago

Usually, the roadrunner is used for a single project with a specific PHP version. If you want to run many applications - you can build and run them in separate docker containers (with a reverse proxy server like a Traefik, Nginx, or HAProxy in front of them, if you want, of course).

tarampampam commented 3 years ago

This issue can be closed?

NguyenDinhKhoi commented 3 years ago

Okay, thank you for your support