macos - Apache 和 passenger 在 Docker mac 和 ubuntu 上的行为不同

标签 macos apache ubuntu docker passenger

当我在 mac 或 linux 上部署运行 apache2 + passenger phusion + rails 应用程序的容器时,我遇到了一些问题。 我使用从 docker hub 中提取的相同图像(基于 ubuntu:14.04)和相同的运行命令

docker run -it -p 80:80 -p 443:443 -e RAILS_ENV=development --link pg my-image-name

在 OSX 10.10.5 上,运行 docker 1.9.1,构建 a34a1d5 一切正常。 在我的生产服务器 ubuntu 14.04.3 LTS 上,运行相同的 docker 版本,我得到以下错误

AH00035: access to / denied (filesystem path '/home/app/app') because search permissions are missing on a component of the path

权限是使用 chmod 775 -R/home/app 设置的。 这是 passenger 和 apache 版本 + 配置

Server version: Apache/2.4.7 (Ubuntu)
Server built:   Oct 14 2015 14:20:21
Phusion Passenger 5.0.22
<VirtualHost *:80>
    ServerName www.my-app.com
    DocumentRoot /home/app/app/public
    PassengerRuby /usr/bin/ruby
    RailsEnv development
    ErrorLog "/home/app/app/log/apache_error_log"
    CustomLog "/home/app/app/log/apache_access_log" common
    <Directory /home/app/app/public>
       AllowOverride all
       Options -MultiViews +FollowSymLinks +Indexes
       Require all granted
       Order allow,deny
       allow from all
    </Directory>
</VirtualHost>

知道为什么我在运行同一容器的 OS X 和 Ubuntu 之间会出现两种不同的行为吗?

谢谢

最佳答案

issue 16741 中所述:

I think I've seen a similar issue, which was related to the aufs driver.

Fixed by using "devicemapper" instead of "aufs" thanks to this post:
"Switching Docker from aufs to devicemapper"

changed /etc/default/docker to enable device mapper:
(save the images first)

# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--storage-driver=devicemapper"

OP Alberto Sabaini确认它有效:

I thought that Ubuntu LTS would be using device mapper as default, but by typing docker info | grep Storage, I get Storage Driver: aufs in both mac and Ubuntu.
The weird part is that my image spin fine on mac with aufs and on Ubuntu on device mapper.

关于macos - Apache 和 passenger 在 Docker mac 和 ubuntu 上的行为不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34673046/

相关文章:

swift - OSX Swift - 显示模态第二个窗口

c++ - 相同的 C++ 代码导致 Windows 上的无限循环和 OSX 上的预期行为

objective-c - OSX/Objective-C 窗口管理 : manipulate the frames & visibility of other applications

apache - 试图让 Websockify/noVNC 通过反向代理工作

c++ - fastCGI 环境变量 - 我可以从哪里获得(标准/官方)列表?

php - Apache - 406 Not Acceptable PHP 问题

MySQL错误,缺少sock,仍然可以连接除命令行之外的所有内容

linux - 如何允许组访问 GIT 存储库 (Ubuntu)

linux - 如何给目录恢复其 sudo 许可/权限?

objective-c - NSWorkspace 启动应用程序 : fails for the first time with root user