Docker interactive exec bash does not show container's filesystem

when I enter a container it doesn’t actually show the container’s filesystem but my regular host-filesystem

e.g.

docker exec -it cranky_mccarthy bash
root@c394feaf6fc8:/# cat /etc/lsb-release
DISTRIB_ID=Debian
DISTRIB_RELEASE=7
DISTRIB_CODENAME=
DISTRIB_DESCRIPTION=
root@c394feaf6fc8:/# exit
root@host:/ cat /etc/lsb-release
DISTRIB_ID=Debian
DISTRIB_RELEASE=7
DISTRIB_CODENAME=
DISTRIB_DESCRIPTION=

whereas the container is actually ubuntu derived

Is this intended behaviour for the new ‘exec’ functionality?

This seems off to me. You should report it on the Github Issues.

This is not how it works for me, can you please do a totally explict test including your docker run and its /etc/lsb

root@382cc7045cef:/etc# more lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
root@382cc7045cef:/etc# exit
[root@t440s docker]# more /etc/
Display all 258 possibilities? (y or n)
[root@t440s docker]# more /etc/redhat-release 
Fedora release 20 (Heisenbug)
[root@t440s docker]# ls /etc/lsb*
ls: cannot access /etc/lsb*: No such file or directory

(ubuntu container running on a fedora box)

docker run -it ubuntu bash
root@a44551c973c4:/# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
[^P^Q]
docker exec -ti a44551c973c4 bash
dircolors: no SHELL environment variable, and no shell type option given
root@a44551c973c4:/# cat /etc/lsb-release
DISTRIB_ID=Debian
DISTRIB_RELEASE=7
DISTRIB_CODENAME=
DISTRIB_DESCRIPTION=

And version info:

aptitude show lxc-docker
Package: lxc-docker
New: yes
State: installed
Automatically installed: no
Version: 1.3.1
Priority: extra
Section: default
Maintainer: support@docker.com
Architecture: amd64
Uncompressed Size: 0
Depends: lxc-docker-1.3.1

Hope this helps

/update, the warning about dircolors seems unrelated, running the ‘cat /etc/lsb-release’ gives the unexpected output as well:

docker exec  a44551c973c4 cat /etc/lsb-release
DISTRIB_ID=Debian
DISTRIB_RELEASE=7
DISTRIB_CODENAME=
DISTRIB_DESCRIPTION=

Ok sorry for this, install documents clearly state that kernel 3.14 or newer should be used. Debian 7.7 by default is on 3.2. Installed new kernel and it’s working now.

Though a runtime warning of some kind would’ve been very helpful.

WOW! awesome! thats a really useful thing to know about.

I’ve added a link to this in https://github.com/docker/docker/pull/7681

As a bug/issue reporter, just happy to see you guys are really using this kind of information and providing nice feedback.

I experienced the same it seems, but I’m on 3.2.0: https://github.com/docker/docker/issues/8976