travis-docker-example icon indicating copy to clipboard operation
travis-docker-example copied to clipboard

Doesn't work anymore

Open remram44 opened this issue 9 years ago • 7 comments

It looks like this doesn't run anymore, because Docker needs to access a key in /etc/docker/key.json. Running the "script:" line with sudo fixed this for me.

Docker might have an option to store its files elsewhere, but I do not know it.

remram44 avatar Apr 23 '15 17:04 remram44

I'm not using docker much anymore so I don't understand the issue. I'll happily merge a pull request if you have a fix in mind. Thanks!

lukecyca avatar Apr 23 '15 18:04 lukecyca

This is the result of building your repository right now

I'm assuming this comes from changes in Docker since your last build

The daemon dies with:

INFO[0000] +job serveapi(unix:///var/run/docker.sock)   
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 
FATA[0000] Shutting down daemon due to errors: Error loading key file /etc/docker/key.json: unable to read key file /etc/docker/key.json: open /etc/docker/key.json: permission denied 
FATA[0000] Post http:///var/run/docker.sock/v1.18/containers/create: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 
[    6.590000] System halted.

Running UML as root fixes it (see this build). However I don't think this is the correct fix...

remram44 avatar Apr 23 '15 18:04 remram44

You're right. This repo was just rebuilt and failed with that error.

lukecyca avatar Apr 23 '15 18:04 lukecyca

I encountered the same issue on my repo: https://github.com/moul/travis-docker/

I had to configure permissions like this: https://github.com/moul/travis-docker/commit/e05feec301dae9cfb169fa70ac11a17ba11a5cda#diff-3fbb47e318cd8802bd325e7da9aaabe8R19 (line 19)

moul avatar Apr 23 '15 20:04 moul

Is there a reason not to run UML as root?

remram44 avatar Apr 23 '15 20:04 remram44

If anyone cares, I'm getting this problem too

$ docker run hello-world
FATA[0000] Post http:///var/run/docker.sock/v1.18/containers/create: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

I wasn't trying to do anything special. Just install docker and see that it works.

felzix avatar May 05 '15 05:05 felzix

Thanks @moul !

@felzix since @moul's version is working fine, I'd suggest switching to his up-to-date repository :)

aimxhaisse avatar May 05 '15 10:05 aimxhaisse