Apache and passenger behave differently on Docker mac vs ubuntu

I’m experiencing some issues with containers running apache2 + passenger phusion + rails app when I deploy them on mac or linux.
I use the same image (based on ubuntu:14.04) pulled from the docker hub and the same run command

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

On OSX 10.10.5, running docker 1.9.1, build a34a1d5 everything works fine.
On my production server ubuntu 14.04.3 LTS, running the same docker version, I get the following error

  • Dockerfile dependency installed properly but resulting image doesn't have it
  • hbase hadoop DNS static init fails with UnknownHostException in docker while spring bean init if log file exists, but works after init
  • How do I run a python script with Tensorflow running in a Docker on Windows?
  • Committing a running docker container (with pause), then run it, what's the images internal state
  • How to disable chrome to use gpu in docker environment
  • How to access War File Build deployed in Tomcat Docker Container after deleting root
  • AH00035: access to / denied (filesystem path '/home/app/app') because search permissions are missing on a component of the path
    

    Permissions are set with chmod 775 -R /home/app.
    Here is passenger and apache version + configuration

    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>
    

    Any idea why I’m getting two different behaviours between OS X and Ubuntu running the same container?

    Thanks

  • Possible to build and run Docker images in Linux VM on Parallels on OS X?
  • IntelliJ IDEA and docker plugin
  • Docker swarm mode scale service issue with one worker
  • GCE Build Fails
  • How do I debug “No default robot”?
  • How to expose in a network?
  • One Solution collect form web for “Apache and passenger behave differently on Docker mac vs ubuntu”

    As commented in 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"
    

    The OP Alberto Sabaini confirms it works:

    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.