首页 > 解决方案 > 当我执行命令时,symfony 5“快速通道”书错误泊坞窗

问题描述

我在 Ubuntu 20.* 上,我有 symfony 5 “快速通道”的书(来自 Fabien Potencier)。但是当我尝试在下面执行这个命令时,它在 Docker 上失败了。

symfony new --version=5.0-1 --book guestbook

请你帮我运行命令:“symfony new --version=5.0-1 --book guestbook”没有任何问题。我不明白为什么我有这个错误:

[WEB] Stopping Docker Containers: [ KO ]
Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Re-run the command with --debug to get more information about the error

这是我执行命令时的 consol 结果:

Checking Book Requirements
--------------------------

[OK] Git installed
[OK] PHP installed version 7.4.3 (/usr/bin/php7.4)
[OK] PHP extension "json" installed
[OK] PHP extension "session" installed
[OK] PHP extension "ctype" installed
[OK] PHP extension "tokenizer" installed
[OK] PHP extension "xml" installed
[OK] PHP extension "redis" installed
[OK] PHP extension "intl" installed
[OK] PHP extension "pdo_pgsql" installed
[OK] PHP extension "xsl" installed
[OK] PHP extension "amqp" installed
[OK] PHP extension "gd" installed
[OK] PHP extension "openssl" installed
[OK] PHP extension "sodium" installed
[OK] Composer installed
[OK] Docker installed
[OK] Docker Compose installed
[OK] Yarn installed


    Cloning the Repository
----------------------

Clonage dans '/var/www/symfony5/guestbook'...
remote: Enumerating objects: 1170, done.
remote: Counting objects: 100% (1170/1170), done.
remote: Compressing objects: 100% (573/573), done.
remote: Total 1170 (delta 557), reused 1170 (delta 557), pack-reused 0
Réception d'objets: 100% (1170/1170), 4.05 Mio | 1.91 Mio/s, fait.
Résolution des deltas: 100% (557/557), fait.

Getting Ready for the Last Step of the Book
-------------------------------------------

[GIT] Check for not yet committed changes: [ OK ]
[GIT] Check Git un-tracked files: [ OK ]

[GIT] Removing Git ignored files (vendor, cache, ...): [ OK ]
[GIT] Resetting Git staged files: [ OK ]
[GIT] Removing un-tracked Git files: [ OK ]
[WEB] Adding .env.local: [ OK ]
[WEB] Stopping Docker Containers: [ KO ]
Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Re-run the command with --debug to get more information about the error

当我执行 --debug 时,我得到相同的结果(相同的错误语句)。我的 docker 正在运行并且可以正常工作:

docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

标签: dockersymfonydocker-compose

解决方案


我需要在 docker 组中添加“我”作为用户(它不是用 doc 编写的,或者远离安装 doc)。


推荐阅读