Docker Beta13 fs sharing problems

Expected behavior

node.js running a React app based on webpack should be able to handle hot reloading on local code changes.

Actual behavior

To me it seems, that the directory where I mount my application code into the container get’s unmounted in the middle of the process. So webpack then can not continue with it’s job. This only happens after the update from Docker Beta 12 to 13.

Information

This is the last log of my application:

myapp_1  | [0]                        Asset     Size  Chunks             Chunk Names
myapp_1  | [0] main-406d2d3ad1641ff056f8.js  7.15 MB       0  [emitted]  main
myapp_1  | [0] webpack built 406d2d3ad1641ff056f8 in 22581ms
myapp_1  | [1] [piping] File src/components/ConfigOneStep/index.js has changed, reloading.
myapp_1  | [0] webpack building...
myapp_1  | [0] webpack built 5f09ca52bdc5bdea51a5 in 3431ms
myapp_1  | [1] events.js:141
myapp_1  | [1]       throw er; // Unhandled 'error' event
myapp_1  | [1]       ^
myapp_1  | [1]
myapp_1  | [1] Error: ENOTCONN: socket is not connected, lstat '/app'
myapp_1  | [1]     at Error (native)
myapp_1  | [1]
myapp_1  | [1] npm
myapp_1  | [1]  info lifecycle
myapp_1  | [1]  myapp-calculator@0.0.1~start-dev: Failed to exec start-dev script
myapp_1  | [1] npm ERR!
myapp_1  | [1]  Linux 4.4.11-moby
myapp_1  | [1] npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start-dev"
myapp_1  | [1] npm ERR! node v5.4.1
myapp_1  | [1] npm ERR!
myapp_1  | [1] npm
myapp_1  | [1]  v3.3.12
myapp_1  | [1] npm ERR!
myapp_1  | [1] code ELIFECYCLE
myapp_1  | [1] npm
myapp_1  | [1] ERR! myapp-calculator@0.0.1 start-dev: `better-npm-run start-dev`
myapp_1  | [1] npm ERR!
myapp_1  | [1]  Exit status 1
myapp_1  | [1] npm
myapp_1  | [1]  ERR!
myapp_1  | [1] npm ERR! Failed at the myapp-calculator@0.0.1 start-dev script 'better-npm-run start-dev'.
myapp_1  | [1] npm ERR! Make sure you have the latest version of node.js and npm installed.
myapp_1  | [1] npm ERR! If you do, this is most likely a problem with the myapp-calculator package,
myapp_1  | [1] npm ERR!
myapp_1  | [1]  not with npm itself.
myapp_1  | [1] npm ERR! Tell the author that this fails on your system:
myapp_1  | [1] npm ERR!     better-npm-run start-dev
myapp_1  | [1] npm ERR! You can get their info via:
myapp_1  | [1] npm ERR!     npm owner ls myapp-calculator
myapp_1  | [1] npm ERR!
myapp_1  | [1]  There is likely additional logging output above.
myapp_1  | [1] npm
myapp_1  | [1] ERR!
myapp_1  | [1]  Linux 4.4.11-moby
myapp_1  | [1] npm
myapp_1  | [1]
myapp_1  | [1] ERR!
myapp_1  | [1]  argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start-dev"
myapp_1  | [1] npm ERR! node v5.4.1
myapp_1  | [1] npm
myapp_1  | [1]  ERR! npm  v3.3.12
myapp_1  | [1] npm ERR!
myapp_1  | [1]  path npm-debug.log.5d5a709a6e3b93e8bc4dc179d8f2a5f5
myapp_1  | [1] npm ERR! code ENOTCONN
myapp_1  | [1] npm ERR! errno -107
myapp_1  | [1] npm ERR! syscall open
myapp_1  | [1]
myapp_1  | [1] npm ERR! ENOTCONN: socket is not connected, open 'npm-debug.log.5d5a709a6e3b93e8bc4dc179d8f2a5f5'
myapp_1  | [1] npm ERR!
myapp_1  | [1] npm ERR! If you need help, you may report this error at:
myapp_1  | [1] npm
myapp_1  | [1]  ERR!     <https://github.com/npm/npm/issues>
myapp_1  | [1]
myapp_1  | [1] npm ERR! Please include the following file with any support request:
myapp_1  | [1] npm ERR!     /app/npm-debug.log
myapp_1  | [1] npm run start-dev exited with code 1
myapp_1  | --> Sending SIGTERM to other processes..
Exception in thread Thread-2:
Traceback (most recent call last):
  File "threading.py", line 810, in __bootstrap_inner
  File "threading.py", line 763, in run
  File "compose/cli/log_printer.py", line 149, in tail_container_logs
  File "compose/cli/log_printer.py", line 179, in wait_on_exit
  File "compose/container.py", line 239, in wait
  File "site-packages/docker/utils/decorators.py", line 21, in wrapped
  File "site-packages/docker/api/container.py", line 439, in wait
  File "site-packages/docker/client.py", line 154, in _raise_for_status
APIError: 500 Server Error: Internal Server Error ("dial unix /Users/foobar/Library/Containers/com.docker.docker/Data/*00000003.00000948: connect: connection refused")

###Pinata Info:

pinata diagnose -u
OS X: version 10.11.4 (build: 15E65)
Docker.app: version v1.11.1-beta13
Running diagnostic tests:
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160526-110833.tar.gz
Most specific failure is: No error was detected
Your unique id is: CCB0A80D-A8AC-449D-A2EC-0B325E04A967
Please quote this in all correspondence.

Steps to reproduce the behavior

####My Dockefile:

FROM node:5.4

RUN mkdir /app
WORKDIR /app

COPY package.json /app/
COPY npm-shrinkwrap.json /app/

RUN npm install

####My docker-compose.yml:

version: '2'
services:

  myapp:
    build:
      context: .
      dockerfile: Dockerfile
    command: npm run dev
    ports:
      - "4000:4000"
      - "4001:4001"
      - "3030:3030"

####My docker-compose.override.yml:

version: '2'
services:

  myapp:
    volumes:
      - .:/app
      - /app/node_modules

The app itself is a fork of:

3 Likes

I’ve cloned the react-redux-universal-hot-example repository and put your three files in it but when I run docker-compose up, I see

Step 5 : COPY npm-shrinkwrap.json /app/
ERROR: Service 'myapp' failed to build: lstat npm-shrinkwrap.json: no such file or directory

Could you please advise me about what else I need to run to build and run the container and observe the error? I tried npm shrinkwrap in the repository root but there were lots of errors about missing packages. If you could share your fork or post your npm-shrinkwrap.json or provide a sequence of steps to generate it, I would be very appreciative.

Oh, I see. The initial repository does not come with a shrinkwrap file. So best is just to remove that step from the Dockerfile. It’s safe and should lead to a reproducable situation.

I quickly setup a repo here: https://github.com/janroesner/dckr-rrr

After docker-compose up the app will be available via http://localhost:3000. If you make changes to the code several times and wait for webpack to rebuild and hot-reload the app, the error will come up. At least with #13. I just switched back to #11 where all things work like expected.

Experiencing something similar with a python container:
OSError: [Errno 107] Socket not connected: '/usr/share/src/core/collections/__init__.py'