openBrowser() causes docker-compose set ups to fail because of spawn EACCESS
Created by: aeneasr
Description
I am running npm start
inside of a docker container that is orchestrated using docker-compose, which isn't working. Running the image with pure docker however works.
This issue was already tackled in #306 but rejected.
Expected behavior
The image should boot up normally.
Actual behavior
I get this exception:
?[33mdeveloper-ui_1 |?[0m > developer-ui@0.1.0 start /usr/src/app
?[33mdeveloper-ui_1 |?[0m > react-scripts start
?[33mdeveloper-ui_1 |?[0m
?[33mdeveloper-ui_1 |?[0m ?cStarting the development server...
?[33mdeveloper-ui_1 |?[0m
?[33mdeveloper-ui_1 |?[0m internal/child_process.js:302
?[33mdeveloper-ui_1 |?[0m throw errnoException(err, 'spawn');
?[33mdeveloper-ui_1 |?[0m ^
?[33mdeveloper-ui_1 |?[0m
?[33mdeveloper-ui_1 |?[0m Error: spawn EACCES
?[33mdeveloper-ui_1 |?[0m at exports._errnoException (util.js:1007:11)
?[33mdeveloper-ui_1 |?[0m at ChildProcess.spawn (internal/child_process.js:302:11)
?[33mdeveloper-ui_1 |?[0m at Object.exports.spawn (child_process.js:383:9)
?[33mdeveloper-ui_1 |?[0m at module.exports (/usr/src/app/node_modules/react-scripts/node_modules/opn/index.js:75:24)
?[33mdeveloper-ui_1 |?[0m at openBrowser (/usr/src/app/node_modules/react-scripts/scripts/start.js:173:3)
?[33mdeveloper-ui_1 |?[0m at Server.devServer.listen (/usr/src/app/node_modules/react-scripts/scripts/start.js:308:5)
?[33mdeveloper-ui_1 |?[0m at Server.g (events.js:286:16)
?[33mdeveloper-ui_1 |?[0m at emitNone (events.js:86:13)
?[33mdeveloper-ui_1 |?[0m at Server.emit (events.js:185:7)
?[33mdeveloper-ui_1 |?[0m at emitListeningNT (net.js:1279:10)
?[33mdeveloper-ui_1 |?[0m at _combinedTickCallback (internal/process/next_tick.js:71:11)
?[33mdeveloper-ui_1 |?[0m at process._tickCallback (internal/process/next_tick.js:98:9)
?[33mdeveloper-ui_1 |?[0m
?[33mdeveloper-ui_1 |?[0m npm info lifecycle developer-ui@0.1.0~start: Failed to exec start script
Environment
Dockerfile
FROM node:6.2
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install --silent; exit 0
# fix for https://github.com/facebookincubator/create-react-app/issues/508
RUN chmod a+x /usr/src/app/node_modules/.bin/react-scripts
ENTRYPOINT npm start
EXPOSE 3000
docker-compose.yml
version: '2'
services:
developer-ui:
build:
context: .
dockerfile: Dockerfile
ports:
- "5001:3000"
Then, specify:
- Operating system: Windows (host)
- Browser and version: not relevant
$ docker-compose -v
docker-compose version 1.8.0, build d988a55
$ docker -v
Docker version 1.12.0, build 8eab29e
Reproducible Demo
Here: https://github.com/arekkas/cra-docker-bug
Solution
Have a setting that disables browser spawn. It's annoying anyways when working with different browers (I use ff for browsing and chrome for dev) ;)