[英]docker compose with Symfony Sylius project on windows 11
我想尝试一个 Symfony sylius 项目,我在 Windows 11 主机操作系统中。
我的作曲家安装运行完美。
我的纱线安装运行完美。
但是当我运行docker compose
成原始源代码 sylius(预配置的 docker)项目时,我抛出了这个错误:
=> CACHED [myproject-php sylius_php_prod 11/21] RUN set -eux; composer install --prefer-dist --no-autoloader 0.0s
=> CACHED [myproject-php sylius_php_prod 12/21] COPY .env .env.prod .env.test .env.test_cached ./ 0.0s
=> CACHED [myproject-php sylius_php_prod 13/21] COPY bin bin/ 0.0s
=> [myproject-php sylius_php_prod 14/21] COPY config config/ 0.1s
=> [myproject-php sylius_php_prod 15/21] COPY public public/ 0.1s
=> [myproject-php sylius_php_prod 16/21] COPY src src/ 0.1s
=> [myproject-php sylius_php_prod 17/21] COPY templates templates/ 0.1s
=> [myproject-php sylius_php_prod 18/21] COPY translations translations/ 0.1s
=> ERROR [myproject-php sylius_php_prod 19/21] RUN set -eux; mkdir -p var/cache var/log; composer dump-a 12.7s
------
> [myproject-php sylius_php_prod 19/21] RUN set -eux; mkdir -p var/cache var/log; composer dump-autoload --class
smap-authoritative; APP_SECRET='' composer run-script post-install-cmd; chmod +x bin/console; sync; bin/conso
ole sylius:install:assets --no-interaction; bin/console sylius:theme:assets:install public --no-interaction:
#0 0.238 + mkdir -p var/cache var/log
#0 0.238 + composer dump-autoload --classmap-authoritative
#0 0.423 Generating optimized autoload files (authoritative)
#0 3.436 Class Payum\Be2Bill\Tests\Be2billOffsiteGatewayFactoryTest located in ./vendor/payum/payum/src/Payum/Be2Bill/Te
ests/Be2BillOffsiteGatewayFactoryTest.php does not comply with psr-4 autoloading standard. Skipping.
#0 3.517 Generated optimized autoload files (authoritative) containing 11434 classes
#0 3.528 + APP_SECRET= composer run-script post-install-cmd
#0 3.732
#0 3.732 Run composer recipes at any time to see the status of your Symfony recipes.
#0 3.732
#0 3.750 Executing script cache:clear [OK]
#0 12.10 Executing script assets:install public
#0 12.53 [OK]
#0 12.53 + chmod +x bin/console
#0 12.58 + sync
#0 12.64 + bin/console sylius:install:assets --no-interaction
': No such file or directory'php
------
failed to solve: executor failed running [/bin/sh -c set -eux; mkdir -p var/cache var/log; composer dump-autoloa
ad --classmap-authoritative; APP_SECRET='' composer run-script post-install-cmd; chmod +x bin/console; sync;
bin/console sylius:install:assets --no-interaction; bin/console sylius:theme:assets:install public --no-interaction]
]: exit code: 127
`docker-compose` process finished with exit code 17
Docker 可以正确创建 var/cache 和 var/log 目录到 OS 主机
但是 docker 没有启动我的容器
为什么 docker 告诉我有关 PHP 目录的信息?
这可能是由于bin/console
文件的行结尾错误。 如果您配置了git autocrlf ,则 git 在所有项目文件中将 LF 替换为 CRLF。 您可以向 Dockerfile 添加一个步骤,以使用dos2unix
将其更改回 LH。 您也可以在 Windows 上将它们更改为 LF,但是您无法在 Windows 上执行它。 无论autocrlf
值如何,要强制它为 LF,您可以将bin/console text eol=lf
从项目根目录添加到.gitattributes
文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.