/proc for docker

Elan Ruusamäe glen at pld-linux.org
Sat Jan 11 18:44:35 CET 2014


hi

you may have already head about awesome docker (https://www.docker.io/), 
but you probably have never tried it.


anyway, there's some problem is that /proc gets setup in container such 
weird way that makes procps tools to complain /proc not mounted.
the problem is that pid dirs exist (ls show they exist), but are not 
accessible (chdir says ENOENT)

the problem can be reproduced with vagrant:
(wiki page: https://www.pld-linux.org/packages/lxc-docker#vagrant )

$ poldek -u vagrant
$ mkdir test; cd test
$ wget -O Vagrantfile 
https://www.pld-linux.org/_export/code/packages/lxc-docker?codeblock=3
$ vagrant up
$ vagrant ssh

with 0.7.0 and earlier, just procps tools (killall, pidof) failed, but 
with 0.7.5 it fails more miserably making even container startup to fail:

$ docker version
Client version: 0.7.0
Go version (client): go1.1.2
Git commit (client): pld-1
Server version: 0.7.0
Git commit (server): pld-1
Go version (server): go1.1.2
Last stable version: 0.7.5, please update docker

$ docker run -i -t ubuntu bash

root at e0ea0ce6904b:/# ls -l /proc
ls: cannot access /proc/1: No such file or directory
ls: cannot access /proc/10: No such file or directory
total 0
??????????  ? ?    ?                  ?            ? 1
??????????  ? ?    ?                  ?            ? 10
dr-xr-xr-x  3 root root               0 Jan 11 17:38 acpi
-r--r--r--  1 root root               0 Jan 11 17:38 buddyinfo
dr-xr-xr-x  4 root root               0 Jan 11 17:38 bus

can't even check /proc/mounts as it's symlink to current pid directory, 
which is not accessible:

root at e0ea0ce6904b:/# ls -l /proc/mounts
lrwxrwxrwx 1 root root 11 Jan 11 17:39 /proc/mounts -> self/mounts
root at e0ea0ce6904b:/# ls -l /proc/self/
ls: cannot access /proc/self/: No such file or directory
root at e0ea0ce6904b:/# ls -l /proc/self
lrwxrwxrwx 1 root root 0 Jan 11 17:37 /proc/self -> 18
root at e0ea0ce6904b:/# ls -l /proc/self/
ls: cannot access /proc/self/: No such file or directory
root at e0ea0ce6904b:/#

with newer docker can't even start container because it needs to access 
/proc/PID/status :
# poldek -s http://carme.pld-linux.org/~glen/th/x86_64/ -u lxc-docker
# service lxc-docker restart

19:41:40 vagrant[load: 0.22]@pld64 ~$ docker version
Client version: 0.7.5
Go version (client): go1.1.2
Git commit (client): pld-1
Server version: 0.7.5
Git commit (server): pld-1
Go version (server): go1.1.2
Last stable version: 0.7.5

19:41:49 vagrant[load: 0.18]@pld64 ~$ docker run -i -t ubuntu bash
2014/01/11 17:41:54 open /proc/1/status: no such file or directory
19:41:54 vagrant[load: 0.17]@pld64 ~$


-- 
glen



More information about the pld-devel-en mailing list