我从 Laravel 开始,遵循官方的安装指南网站。
所以我必须用这个安装 Docker指导。
当我运行最后一个命令时它工作正常
sudo docker run hello-world
然后,按照 Laravel 站点上的指南运行以下命令:
curl -s https://laravel.build/example-app | bash
正如它所说,创建一个 Laravel 应用程序。
但当我这样做时,它不起作用并且出现此消息:
Docker is not running.
systemctl status docker 的输出
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-03-24 09:55:07 EDT; 6min ago
Docs: https://docs.docker.com
Main PID: 1445 (dockerd)
Tasks: 13
CGroup: /system.slice/docker.service
└─1445 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Mar 24 09:55:06 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:06.568086445-04:00" level=warning msg="Your kernel does not support CPU realtime scheduler"
Mar 24 09:55:06 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:06.568093668-04:00" level=warning msg="Your kernel does not support cgroup blkio weight"
Mar 24 09:55:06 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:06.568100040-04:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Mar 24 09:55:06 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:06.568236866-04:00" level=info msg="Loading containers: start."
Mar 24 09:55:07 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:07.227307787-04:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
Mar 24 09:55:07 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:07.501565370-04:00" level=info msg="Loading containers: done."
Mar 24 09:55:07 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:07.551553136-04:00" level=info msg="Docker daemon" commit=363e9a8 graphdriver(s)=overlay2 version=20.10.5
Mar 24 09:55:07 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:07.551881250-04:00" level=info msg="Daemon has completed initialization"
Mar 24 09:55:07 wrrnrtm-A320M-HD2 systemd[1]: Started Docker Application Container Engine.
Mar 24 09:55:07 wrrnrtm-A320M-HD2 dockerd[1445]: time="2021-03-24T09:55:07.578162675-04:00" level=info msg="API listen on /var/run/docker.sock"
我不知道我做错了什么。我正在使用 Xubuntu 18.04
答案1
我相信 Docker 未配置为与普通用户一起运行。
尝试使用 sudo 运行你的curl:
sudo curl -s https://laravel.build/example-app | bash
如果有效,那就是权限问题。如果你想用普通用户运行 docker,请将其添加到 docker 组:
sudo usermod -aG docker your_user
此后您可能需要重新启动计算机。