I am creating a very basic image on my debian wheezy host machine. This is the Dockerfile:
FROM ubuntu:trusty
USER root
# Activate multiverse repos
RUN echo 'deb http://archive.ubuntu.com/ubuntu/ trusty universe multiverse' >> /etc/apt/sources.list
RUN echo 'deb http://security.ubuntu.com/ubuntu trusty-security universe multiverse' >> /etc/apt/sources.list
RUN echo 'deb http://archive.ubuntu.com/ubuntu/ trusty-updates universe multiverse' >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y supervisor
WORKDIR /
CMD ["/usr/bin/supervisord", "-n"]
To build the image, I used docker build -t basic-ubuntu .
To run the container, I used docker run -d basic-ubuntu
To go into the container, I used docker exec -i -t <container_id> bash
When I am into the container, what I see is that the container's root directory /
has the same content as the host. When I create a file on the container, it's also created on the host. Even when I add in the Dockerfile a RUN apt-get install -y
of some package I don't have on the host, then I don't find it on the container. Actually even the $PATH variable on the container is the same as the host.
Here are some info on my env
host$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.8 (wheezy)
Release: 7.8
Codename: wheezy
host$ docker version
Client:
Version: 1.10.1
API version: 1.22
Go version: go1.5.3
Git commit: 9e83765
Built: Thu Feb 11 19:20:12 2016
OS/Arch: linux/amd64
Server:
Version: 1.10.1
API version: 1.22
Go version: go1.5.3
Git commit: 9e83765
Built: Thu Feb 11 19:20:12 2016
OS/Arch: linux/amd64
The mounts shown by docker inspect
"Mounts": []
For the full docker inspect trace: http://pastebin.com/t4uSu4ZH
I think that the problem comes from the docker exec step. Because the build and run seem to work correctly.