Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Any other conditions are required of docker? #3

Closed
Raxxor opened this issue Jun 15, 2017 · 7 comments
Closed

Any other conditions are required of docker? #3

Raxxor opened this issue Jun 15, 2017 · 7 comments

Comments

@Raxxor
Copy link

Raxxor commented Jun 15, 2017

ubuntu16.04 Docker version 17.03.1-ce, build c6d412e

When I tried

docker exec bot-render-container curl http://localhost:8080/?url=https://dynamic-meta.appspot.com

docker console output following logs

Listening on port 8080
{ Error: connect ECONNREFUSED 127.0.0.1:9222
at Object.exports._errnoException (util.js:1014:11)
at exports._exceptionWithHostPort (util.js:1037:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1138:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 9222 }

@samuelli
Copy link
Contributor

Did you build with the --no-cache flag?

@samuelli
Copy link
Contributor

See also #2 which they required --disable-sandbox

@LasaleFamine
Copy link

I confirm the same problem on MacOS. I solved the problem adding the --disable-sandbox flag within the chromium.js file.

Maybe this should be written on the README 👍

@samuelli
Copy link
Contributor

Yup, will do. Interestingly the original issue here was on Ubuntu, so I'm curious as to whether its the same problem. @Raxxor: does this fix it for you?

@Raxxor
Copy link
Author

Raxxor commented Jun 23, 2017

Thanks for @samuelli & @LasaleFamine 's comments.
Docker was built by dockerhub, so it is buit with "no cache" mode. Now I am pulling images from dockerhub with adding "--disable-sandbox' in chromium.js.
BTW, i tried to run original files , and some pages was not rendered successfully.

Listening on port 3002
(node:14407) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: not opened
(node:14407) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

samuelli pushed a commit that referenced this issue Jun 28, 2017
This patch does a few things:

1. Moves to Chrome Stable (since headless is now in 59).
2. Reduces the layer count in the docker file build.
3. Fixes lint errors in Dockerfile
4. Adds a non-privileged user called `botrender` to container (so you don't have to use `--unsafe-perm` with the npm install)
5. Expose 8080 for port binding and add documentation to allow running against service without `docker exec`
6. Document seccomp and SYS_ADMIN flags to reduce ECONNREFUSED confusion and use of `--disable-sandbox` as noted in #3
@samuelli
Copy link
Contributor

@justinribeiro has landed added some great recommendations to the readme which address this, so I'm closing this issue. Please file issues for more errors that you might be experiencing.

@Raxxor: can you file separate issues for anything else you might be seeing?

@nhducseuit
Copy link

nhducseuit commented Mar 18, 2018

I'm on MacOS sierra and get { message: 'net::ERR_CONNECTION_REFUSED' } whenever I try to render or screenshot the tour of heroes project launching with ng serve
I checked and tried the suggestions at https://github.com/GoogleChrome/rendertron#connection-error-econnrefused but none of them works.
Could you please suggest where should I add the --disable-sandbox flag to?

I have done following commands:

git clone https://github.com/GoogleChrome/rendertron.git server
cd server

docker build -t rendertron . --no-cache=true

docker run -it -p 8080:8080 --name rendertron-container rendertron

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants