lambda-docker icon indicating copy to clipboard operation
lambda-docker copied to clipboard

<class 'docker.errors.DockerException'> at / Error while fetching server API version: ('Connection aborted.', error(13, 'Permission denied'))

Open stefiane opened this issue 8 years ago • 5 comments

1.Run container by command:docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp -p 8080:8080 tobegit3hub/lambda-docker 2.open browser,visit :http://10.110.13.31:8080/ 3.edit python2.7 shell,then error occurs

Question:did i need to config my docker daemon?

stefiane avatar Jan 04 '17 03:01 stefiane

You don't need to configure anything if you have installed docker daemon in Linux.

It seems "Permission denied". Can you access /var/run/docker.sock or run with sudo?

tobegit3hub avatar Jan 04 '17 04:01 tobegit3hub

I have root authority .what's the meaning of " access /var/run/docker.sock"? I configure my docker daemon(version 1.10) with --selinux-enabled -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --insecure-registry 10.110.13.187:5001.

stefiane avatar Jan 04 '17 05:01 stefiane

I fixed this problem.Use command:docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp --privileged=true -p 8090:8080 tobegit3hub/lambda-docker,then fixed

stefiane avatar Jan 04 '17 08:01 stefiane

Nice try and thanks for your comment.

I'm not sure if --privileged=true is necessary to access latest docker socket file now. Anyway, I'm gonna add this in README so that everyone can use it easily.

If you're interested, any PR about this will be welcome. @stefiane

tobegit3hub avatar Jan 04 '17 09:01 tobegit3hub

In my scene, because I have root authority,then ‘Permission denied’ occured.Example ,I test Python2.7 by web page(online code),then a container based image(python:2.7) is running,but docker logs <yourcontainerID> return info:python: can't open file 'main.py': [Errno 13] Permission denied.

So I propose to add privileged=true when you create container in your source code. @tobegit3hub

stefiane avatar Jan 05 '17 02:01 stefiane