在vmware的stream浪汉docker中的uwsgi – socket没有被创build

在我的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中,该文件夹被设置为用于具有写入权限的每个人的共享。 这是安装在stream浪的虚拟机,它是777,在docker集装箱也是777.我可以在所有3个地方的目录中创build文件。 但似乎uwsgi无法创build套接字。

我尝试了一个简短的Python脚本作为stream浪汉的testing,并且不能创build套接字:

 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 

任何人都知道如何解决这个问题?

更新:我改变了目录/ tmp我可以用我的python脚本创build一个套接字,但仍uwsgi失败,同样的错误。

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

使用/vagrant之外的其他文件夹。 我通常使用/ home / vagrant

问题是/vagrant与普通文件夹不一样。 如果执行命令mount | grep vagrant mount | grep vagrant你会发现它使用了一个vboxfs文件系统,由于某些原因,它不能很好地与docker结合