gpt4 book ai didi

linux - docker运行时无法执行docker命令

转载 作者:太空宇宙 更新时间:2023-11-04 10:47:17 25 4
gpt4 key购买 nike

我正在尝试运行以下 docker 命令:

docker run --name my_postgres -d -p 127.0.0.1:5432:5432 -v /volumes/data:/var/lib/postgresql/data postgres

但是我收到以下错误:

2015/09/15 20:57:57 Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

这很奇怪,因为我在我的计算机上启动并运行了 docker:

~  ps aux | grep docker
root 31083 0.1 0.0 355636 15420 ? Ssl 20:58 0:00 /usr/bin/docker.io -d

最佳答案

使用 sudo docker run .... 或阅读以下页面为您的 docker 启用非 sudo 运行 https://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo

关于linux - docker运行时无法执行docker命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32594668/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com