Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

volumes: volume creation and mount fails on clear linux #23

Closed
mcastelino opened this issue Jul 18, 2016 · 9 comments
Closed

volumes: volume creation and mount fails on clear linux #23

mcastelino opened this issue Jul 18, 2016 · 9 comments

Comments

@mcastelino
Copy link
Contributor

mcastelino commented Jul 18, 2016

On clear linux I am unable to launch a container with an attached volume.
This failure is present both with runc and cors

docker-upstream run -it --runtime runc --name webxx -v /webappxx training/webapp python app.py
docker-upstream run -it runc --name webyy -v /webappyy training/webapp python app.py

Both these fail with the error
docker-upstream: An error occurred trying to connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=webxx: EOF.

The same command works on ubuntu

@jodh-intel
Copy link
Contributor

This works perfectly for me:

mkdir -p /tmp/shared
$ sudo docker-upstream run --runtime cor -ti -v /tmp/shared:/shared busybox

Sounds like dockerd/containerd might be confused. Does a service restart help?

@mcastelino
Copy link
Contributor Author

@jodh-intel that is the only option that works I think (the local directory sharing). Did this command work for you
docker-upstream run -it --runtime runc --name webxx -v /webappxx training/webapp python app.py

You use fedora right? I wonder if its a clear specific issue?

@jodh-intel
Copy link
Contributor

@mcastelino - I was running on clr. If the problem affects both cor and runc, that sounds like either a problem with docker/containerd or the docker image you are using.

@grahamwhaley
Copy link

grahamwhaley commented Jul 29, 2016

@mcastelino @jodh-intel So I think we need to decide if this is a CC or CLR issue, and assign as appropriate. From details so far it seems to be leaning towards CLR to me.

@grahamwhaley grahamwhaley added P2 P1 and removed P2 labels Jul 29, 2016
@grahamwhaley grahamwhaley added this to the Container 2.0 milestone Aug 5, 2016
@grahamwhaley grahamwhaley added P2 and removed P1 labels Aug 9, 2016
@jcvenegas
Copy link
Contributor

@mcastelino
The command:
docker run -it --runtime runc --name webxx -v /webappxx training/webapp python app.py

Does not break docker in Clear Linux version 9950, It work with both cc-oci-runtime and runc.

@mrkz
Copy link

mrkz commented Aug 19, 2016

I'm also having this Issue using the docker-cor service on clearlinux release 10030.
It mounts correctly the volume when using the runc runtime rather than cc-oci-runtime(clearlinux default).

to reproduce, you need to previously start the docker-cor service and pull the clearlinux container image docker pull clearlinux.

root@magneto ~ # docker run -v /etc/hostname:/root/hostname -it clearlinux                                            
docker: Error response from daemon: containerd: container not started.
root@magneto ~ # docker run --runtime runc -v /etc/hostname:/root/hostname -it clearlinux                             
root@e290fcf4814f / # cat /root/hostname 
magnetoroot@e290fcf4814f / # 

This is what I get from # journalctl -f -u docker-cor

Aug 19 14:34:10 magneto dockerd[27147]: time="2016-08-19T14:34:10.091458734Z" level=error msg="containerd: start container" error="containerd: container not started" id=9246c0c1bbf0856379b9a407662027280b440268ad3f731a0f876a798613e45f
Aug 19 14:34:10 magneto dockerd[27147]: time="2016-08-19T14:34:10.095181963Z" level=error msg="Create container failed with error: containerd: container not started"
Aug 19 14:34:10 magneto dockerd[27147]: time="2016-08-19T14:34:10.258256511Z" level=error msg="Handler for POST /v1.24/containers/9246c0c1bbf0856379b9a407662027280b440268ad3f731a0f876a798613e45f/start returned error: containerd: container not started"



Aug 19 14:34:24 magneto dockerd[27147]: time="2016-08-19T14:34:24.061972523Z" level=error msg="libcontainerd: failed to convert event timestamp: \"timestamp: nil Timestamp\""

First 3 lines of journalctl are from the failed
# docker run -v /etc/hostname:/root/hostname -it clearlinux
while the last line is produced in journalctl is when running
docker run --runtime runc -v /etc/hostname:/root/hostname -it clearlinux

@jodh-intel
Copy link
Contributor

@mrkz - thanks for the extra info. I can see now that the runtime assumes the "volume" is a directory, but clearly it doesn't have to be :-)

@jodh-intel
Copy link
Contributor

To resolve this issue, the runtime needs to perform a check on the mount.source and if it's a regular file, create the specified mount.destination to allow the bind mount to succeed.

@jcvenegas
Copy link
Contributor

I am PR for that

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

No branches or pull requests

7 participants