This is a duplicate of a post i have made in the docker forum. Thus iam going to close this / the other one once this problem is solved. But since no one answers in the docker forum and my problems persists, ill post it again looking forward to get an answer.
I would like to expose a server monitoring app as a docker container. The app i have written relies on /proc to read system information like CPU utilization or disk stats. Thus i have to forward the information provided in hosts /proc virtual file system to my docker container.
So i made a simple image (using the first or second intro on docker website: Link) and started it:
docker run -v=/proc:/host/proc:ro -d hostfiletest
docker run -v=/proc:/host/proc:ro -d hostfiletest Assuming the running container could read from /host/proc to obtain information about the host system.
I fired up a console inside the container to check:
docker exec -it {one of the funny names the container get} bash
And checked the content of /host/proc.
Easiest way to check it was getting the content of /host/proc/sys/kernel/hostname - that should yield the hostname of the vm iam working on. But i get the hostname of the container, while /host/proc/uptime gets me the correct uptime of the vm.
Do i miss something here? Maybe something conceptual?
Docker version 17.05.0-ce, build 89658be running on Linux 4.4.0-97-generic (VM)
Update:
I found several articles describing how to run a specific monitoring app inside a containing using the same approach i mentioned above.
Update:
Just tried using an existing Ubuntu image - same behavior. Running the image privileged and with pid=host doesn't help.
Greetings Peepe