Compose on Ubuntu (1.5.2) vs OSX (1.5.1) - or how to map volumes?

Hi,

I am seeing a difference of behaviour between OSX and Ubuntu Compose.

My dockerfile/compose files are here: https://github.com/kimptoc/wowactivityfeed

What I am trying to do is:

  • it’s a NodeJs app - the code is in the current directory
  • Dockerfile copies the package.json/shrinkwrap file into the image and then runs npm install to get the related modules
  • docker-compose file mounts the current directory into the container.

Under OSX, when I run docker-compose up, it shows the installed node modules as well as the local directory.

However under ubuntu the working directory replaces the image directory and so the modules are not visible.

Ubuntu docker info:

$ sudo docker info
Containers: 14
Images: 129
Server Version: 1.9.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 157
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-74-generic
Operating System: Ubuntu 14.04.3 LTS
CPUs: 4
Total Memory: 1.955 GiB
Name: rhs1
ID: IX2E:AGTJ:DGC2:HLLR:4H3M:KH4J:2E37:46KU:MZ7S:OBLG:XHJG:XYG6
WARNING: No swap limit support

Whereas on OSX:

Containers: 3
Images: 39
Server Version: 1.9.1
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 45
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.1.13-boot2docker
Operating System: Boot2Docker 1.9.1 (TCL 6.4.1); master : cef800b - Fri Nov 20 19:33:59 UTC 2015
CPUs: 1
Total Memory: 996.2 MiB
Name: default
ID: OKRT:CJ7X:O6L7:SIA2:4NCT:QBJG:PGRY:WCS5:CKD4:S6VO:63JF:HMWT
Debug mode (server): true
 File Descriptors: 12
 Goroutines: 20
 System Time: 2015-12-28T21:07:53.705692669Z
 EventsListeners: 0
 Init SHA1:
 Init Path: /usr/local/bin/docker
 Docker Root Dir: /mnt/sda1/var/lib/docker
Labels:
 provider=virtualbox

Wonder if the kernel version is the issue?

Thanks in advance for tips/suggestions.
Chris

FYI

I previously had no VOLUME entry in my Dockerfile.

The working directory was /app/wowfeed - adding a VOLUME entry for /app/wowfeed/node_modules seems to have fixed my issue.

Presumably that gets merged with my working directory due to the VOLUME entry.

Still need to work out the workflow for updating node packages…