vmware中vagrant中docker中的uwsgi-未创建套接字

vmware中vagrant中docker中的uwsgi-未创建套接字,docker,nginx,vagrant,vmware,uwsgi,Docker,Nginx,Vagrant,Vmware,Uwsgi,在我的mac电脑上,我在VMware中运行Windows Server 2016。在那里,我在vagrant/Virtual Box中运行Ubuntu。在那里,我正试图用nginx/uwsgi在docker容器中运行django应用程序 uwsgi未能从以下方面入手: [uWSGI] getting INI configuration from /opt/django/CAPgraph/uwsgi.ini *** Starting uWSGI 2.0.15 (64bit) on [Thu Aug

在我的mac电脑上,我在VMware中运行Windows Server 2016。在那里,我在vagrant/Virtual Box中运行Ubuntu。在那里,我正试图用nginx/uwsgi在docker容器中运行django应用程序

uwsgi未能从以下方面入手:

[uWSGI] getting INI configuration from /opt/django/CAPgraph/uwsgi.ini
*** Starting uWSGI 2.0.15 (64bit) on [Thu Aug 17 20:01:23 2017] ***
compiled with version: 6.4.0 20170805 on 17 August 2017 06:10:50
os: Linux-3.13.0-128-generic #177-Ubuntu SMP Tue Aug 8 11:40:23 UTC 2017
nodename: 37db4344b5ae
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
chdir() to /opt/django/CAPgraph/
your memory page size is 4096 bytes
detected max file descriptor number: 524288
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
bind(): Operation not permitted [core/socket.c line 230] 
在VMware中,文件夹设置为可供具有写入权限的所有人共享。它安装在vagrant VM中,它是777,docker容器中也是777。我可以在目录中从所有3个位置创建文件。但似乎uwsgi无法创建套接字

我尝试了一个简短的python脚本作为vagrant的测试,但也无法创建套接字:

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ python -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('/vagrant/app.sock')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 1] Operation not permitted
vagrant@vagrant-ubuntu-trusty-64:/vagrant$python-c“将套接字作为s导入;sock=s.socket(s.AF_UNIX);sock.bind('/vagrant/app.sock')”
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/usr/lib/python2.7/socket.py”,第224行,meth格式
返回getattr(self.\u sock,name)(*args)
socket.error:[Errno 1]不允许操作
有人知道我如何解决这个问题吗

更新:我将dir改为/tmp,在那里我可以用python脚本创建套接字,但uwsgi仍然失败,并出现相同的错误


更新2:我用python脚本在/tmp中创建了套接字,chmod将其修改为777,但仍然从uwsgi中得到了相同的错误

使用除
/vagrant
以外的任何其他文件夹。我通常使用/home/vagrant


问题在于
/vagrant
与普通文件夹不同。如果执行命令
mount | grep vagrant
,您会发现它使用的是
vboxfs
文件系统,由于某些原因,该文件系统与docker不兼容请使用
/vagrant
以外的任何其他文件夹。我通常使用/home/vagrant


问题在于
/vagrant
与普通文件夹不同。如果您执行命令
mount | grep vagrant
,您会发现它使用的是
vboxfs
文件系统,由于某些原因,它与docker不兼容

,问题在于
/vagrant
与普通文件夹不同。如果执行命令
mount | grep vagrant
,您会发现它使用的是
vboxfs
文件系统,并且与Dockerant不兼容。关于如何解决此问题,请使用
/vagrant
以外的任何其他文件夹。我通常使用
/home/vagrant
谢谢-这就成功了!我说得有点太早了。正在创建套接字,但当我尝试连接到站点时,它失败了,出现以下nginx错误:
2017/08/19 16:56:29[crit]1251#1251:*1 connect()到unix:///opt/django/CAPgraph/app.sock 连接到上游时失败(13:权限被拒绝),客户端:10.0.2.2,服务器:,请求:“GET/HTTP/1.1”,上游:"uwsgi://unix:///opt/django/CAPgraph/app.sock:,主机:“localhost:9003“
我已验证app.sock文件和路径上的所有dir都是777。问题是
/vagrant
与普通文件夹不同。如果执行命令
mount | grep vagrant
,您会发现它使用的是
vboxfs
文件系统,并且与Dockerant不兼容。关于如何解决此问题,请使用
/vagrant
以外的任何其他文件夹。我通常使用
/home/vagrant
谢谢-这就成功了!我说得有点太早了。正在创建套接字,但当我尝试连接到站点时,它失败了,出现以下nginx错误:
2017/08/19 16:56:29[crit]1251#1251:*1 connect()到unix:///opt/django/CAPgraph/app.sock 连接到上游时失败(13:权限被拒绝),客户端:10.0.2.2,服务器:,请求:“GET/HTTP/1.1”,上游:"uwsgi://unix:///opt/django/CAPgraph/app.sock:,主机:“localhost:9003”
我已经验证了app.sock文件和路径上的所有dir都是777。