execution of chown(container files) get hung - docker

I'm trying to run Zalenium docker on ubuntu 18.04. Below is my command.
curl -sSL https://raw.githubusercontent.com/dosel/t/i/p | bash -s start
or
docker run --rm -ti -p 4404:4444 -v /var/run/docker.sock:/var/run/docker.sock -v /home/emiteqa/eMite/videos:/home/seluser/videos --privileged dosel/zalenium start
I got stuck at "Copying files for Dashboard"
Docker binary already present, will use that one.
Docker version 18.09.0, build 4d60db4
-- LOG 07:33:35:233537096 Ensuring docker works...
-- LOG 07:33:35:414698248 Ensuring docker-selenium is available...
haveged: haveged starting up
Copying files for Dashboard...
After investigate, I find the cause is the zalenium get hung at below line in zalenium.sh
sudo chown -R ${HOST_UID}:${HOST_GID} /home/seluser
Then, I go into the zalenium container. I try to run sudo chown on any file in the container, it get stuck.
seluser#5ada56c01231:~$ ls -ltr
total 40396
-rwxrwxr-x 1 seluser root 41277 Nov 24 15:23 zalenium.sh
-rwxrw-r-- 1 seluser root 15086 Nov 24 15:23 zalando.ico
-rwxrwxr-x 1 seluser root 770 Nov 24 15:23 wait-testingbot.sh
-rwxrwxr-x 1 seluser root 983 Nov 24 15:23 wait-saucelabs.sh
-rwxrwxr-x 1 seluser root 933 Nov 24 15:23 wait-lambdatest.sh
-rwxrwxr-x 1 seluser root 746 Nov 24 15:23 wait-cbt.sh
-rwxrwxr-x 1 seluser root 831 Nov 24 15:23 wait-browserstack.sh
-rwxrwxr-x 1 seluser root 1268 Nov 24 15:23 start-testingbot.sh
-rwxrwxr-x 1 seluser root 2679 Nov 24 15:23 start-saucelabs.sh
-rwxrwxr-x 1 seluser root 1061 Nov 24 15:23 start-lambdatest.sh
-rwxrwxr-x 1 seluser root 1078 Nov 24 15:23 start-cbt.sh
-rwxrwxr-x 1 seluser root 1287 Nov 24 15:23 start-browserstack.sh
-rwxrw-r-- 1 seluser root 2699 Nov 24 15:23 logging_info.properties
-rwxrw-r-- 1 seluser root 2738 Nov 24 15:23 logging_debug.properties
-rwxrw-r-- 1 seluser root 1082 Nov 24 15:23 logback.xml
-rwxrw-r-- 1 seluser root 2128 Nov 24 15:23 LICENSE.md
-rwxrw-r-- 1 seluser root 637 Nov 24 15:23 error.html.bak
-rwxrw-r-- 1 seluser root 10996 Nov 24 15:23 dashboard_template.html
-rwxrw-r-- 1 seluser root 4529 Nov 24 15:23 Analytics.md
-rw-rw-r-- 1 root root 41184199 Nov 24 15:23 zalenium-3.141.59v.jar
drwxrwxr-x 1 seluser root 4096 Nov 24 15:27 css
drwxrwxr-x 1 seluser root 4096 Nov 24 15:27 js
drwxrwxr-x 1 seluser root 4096 Nov 24 15:27 img
drwxrwxr-x 5 seluser seluser 4096 Dec 5 01:56 videos
-rwxrw-r-- 1 seluser seluser 3420 Dec 6 07:00 nginx.conf.bak
-rwxrw-r-- 1 seluser seluser 3404 Dec 6 07:00 nginx.conf
-rwxrw-r-- 1 seluser seluser 627 Dec 6 07:00 error.html
drwxr-xr-x 2 seluser seluser 4096 Dec 6 07:00 logs
-rw-r--r-- 1 seluser seluser 1181 Dec 6 07:00 docker_info.txt
seluser#5ada56c01231:~$ pwd
/home/seluser
seluser#5ada56c01231:~$ sudo chown seluser:seluser wait-testingbot.sh
^C^C
seluser#5ada56c01231:~$ ^C
seluser#5ada56c01231:~$ sudo chown seluser:seluser wait-testingbot.sh
seluser#5ada56c01231:~$ sudo chown seluser:seluser wait-saucelabs.sh
^C^C
seluser#5ada56c01231:~$ sudo chown seluser:seluser wait-saucelabs.sh
seluser#5ada56c01231:~$
What I have tried
If I touch a new file and run sudo chown, there is no problem.
If I CTRL+C and retry, it will pass.
By using exact same steps starting from docker installation, I can run zalenium successfully on aws
server.
I googled, but didn't find any similar issue. I know it's possibly due to env issue, but I have no clue how to troubleshoot.
Thanks in advance for any suggestion and help.

Related

how to run a dbt container from command line with volumes

was trying to make a quick dbt container:
docker pull xemuliam/dbt
docker run -d --name dbt \
-p 8085:8085 \
-v /home/mypath/app:/usr/app \
xemuliam/dbt:latest
that didn't work, so i tried to inspect and saw the binding was rprivate, so i changed it to:
docker run -d --name dbt \
-p 8085:8085 \
-v /home/mypath/app:/usr/app,rshared:rshared \
xemuliam/dbt:latest
the issue is that /home/mypath/app ends up being empty, and if i go inside the container it has in the working directory of /usr/app:
drwxr-xr-x 15 root root 4096 Apr 29 12:24 .
drwxr-xr-x 1 root root 4096 Jun 21 20:14 ..
-rw-rw-r-- 1 root root 4895 Apr 28 16:54 ARCHITECTURE.md
-rwxrwxr-x 1 root root 16732 Apr 28 16:54 CHANGELOG.md
-rw-rw-r-- 1 root root 18081 Apr 28 16:54 CONTRIBUTING.md
-rw-rw-r-- 1 root root 2239 Apr 28 16:54 Dockerfile.test
-rw-rw-r-- 1 root root 11344 Apr 28 16:54 License.md
-rw-rw-r-- 1 root root 3271 Apr 28 16:54 Makefile
-rw-rw-r-- 1 root root 2365 Apr 28 16:54 README.md
drwxrwxr-x 5 root root 4096 Apr 28 16:54 core
drwxrwxr-x 4 root root 4096 Apr 29 12:23 dbt-core-1.1.0
-rw-rw-r-- 1 root root 205 Apr 28 16:54 dev-requirements.txt
drwxrwxr-x 2 root root 4096 Apr 28 16:54 docker
-rw-rw-r-- 1 root root 777 Apr 28 16:54 docker-compose.yml
drwxrwxr-x 3 root root 4096 Apr 28 16:54 docs
-rw-rw-r-- 1 root root 51 Apr 28 16:54 editable-requirements.txt
drwxrwxr-x 2 root root 4096 Apr 28 16:54 etc
drwxrwxr-x 3 root root 4096 Apr 28 16:54 events
-rw-rw-r-- 1 root root 65 Apr 28 16:54 mypy.ini
drwxrwxr-x 8 root root 4096 Apr 28 16:54 performance
drwxrwxr-x 6 root root 4096 Apr 28 16:54 plugins
-rw-r--r-- 1 root root 95 Apr 29 12:23 plugins.txt
-rw-rw-r-- 1 root root 242 Apr 28 16:54 pytest.ini
-rw-rw-r-- 1 root root 26 Apr 28 16:54 requirements.txt
drwxrwxr-x 2 root root 4096 Apr 28 16:54 scripts
drwxrwxr-x 5 root root 4096 Apr 28 16:54 test
drwxrwxr-x 7 root root 4096 Apr 28 16:54 tests
drwxrwxr-x 10 root root 4096 Apr 28 16:54 third-party-stubs
-rw-rw-r-- 1 root root 798 Apr 28 16:54 tox.ini
drwxr-xr-x 2 root root 4096 Apr 29 12:24 wheels
in my postgres db i am able to do a volume like this and it works:
-v /home/mypath/data:/var/lib/postgresql/data
i would like to access that stuff on the host so i can play around with editing it.
this is probably the worst way to get this done, so i would appreciate a better answer - but my solution:
step 1: pull image
$ podman pull xemuliam/dbt
step 2: create a container through cli instead of dockerfile
$ podman run -d --name db_dbt \
-p 8085:8085 \
-v /home/myusr/dbt_test/_official:/home/dbt_test/_official \
xemuliam/dbt:latest
step 3: copy files from /usr/app to /home/dbt_test/_official
$ cp -R /usr/app/* /home/dbt_test/_official
exit
$ podman stop db_dbt && podman rm db_dbt
step 4: copy files on the host
$ mkdir /home/myusr/dbt_test/app1
$ cp -R /home/myusr/dbt_test/_official/* /home/myusr/dbt_test/app1/
step 5: create a new volume
$ podman run -d --name db_dbt \
-p 8085:8085 \
-v /home/myusr/dbt_test/app1/:/usr/app/ \
xemuliam/dbt:latest
i really dont like this roundabout way, but now i am able to edit from the host and see what the container does.

Questions about docker -v not working --> /srv/monero/chain:/home/monero/.bitmonero [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last month.
Improve this question
Dockerfile
https://github.com/monero-project/monero/blob/master/Dockerfile
When I execute the following command
docker run -it --restart always --name monero -v /srv/monero/chain:/home/monero/.bitmonero -v /srv/monero/wallet:/wallet --privileged=true monero
Exception in main! boost::filesystem::create_directory: Permission denied: "/home/monero/.bitmonero/lmdb"
Next, I added -u root:root
docker run -it -u root:root --restart always --name monero -v /srv/monero/chain:/home/monero/.bitmonero -v /srv/monero/wallet:/wallet --privileged=true monero
successful
But there are no files in the /srv/monero/chain directory
I think this is a problem I have with docker, I am a docker newbie and it has nothing to do with monero
Additional Information
root#HEY13233121:~# docker run -it -d -u root --restart always --name monero --network net-1 --network-alias monero -v /srv/monero/chain:/home/monero/.bitmonero -v /srv/monero/wallet:/wallet -v /etc/localtime:/etc/localtime:ro --privileged=true monero
8e0a63230adf3ead036360e3662b00c95085776791eebab44d87a8123fff09d8
root#HEY13233121:~# docker exec -it monero bash
root#8e0a63230adf:/# ll
total 80
drwxr-xr-x 1 root root 4096 Mar 26 05:24 ./
drwxr-xr-x 1 root root 4096 Mar 26 05:24 ../
-rwxr-xr-x 1 root root 0 Mar 26 05:24 .dockerenv*
drwxr-xr-x 2 root root 4096 Jan 14 10:45 bin/
drwxr-xr-x 2 root root 4096 Apr 12 2016 boot/
drwxr-xr-x 13 root root 3760 Mar 26 05:24 dev/
drwxr-xr-x 1 root root 4096 Mar 26 05:24 etc/
drwxr-xr-x 1 root root 4096 Mar 25 23:46 home/
drwxr-xr-x 1 root root 4096 Sep 13 2015 lib/
drwxr-xr-x 2 root root 4096 Jan 14 10:44 lib64/
drwxr-xr-x 2 root root 4096 Jan 14 10:43 media/
drwxr-xr-x 2 root root 4096 Jan 14 10:43 mnt/
drwxr-xr-x 2 root root 4096 Jan 14 10:43 opt/
dr-xr-xr-x 250 root root 0 Mar 26 05:24 proc/
drwx------ 1 root root 4096 Mar 26 05:24 root/
drwxr-xr-x 1 root root 4096 Jan 14 10:44 run/
drwxr-xr-x 1 root root 4096 Mar 25 18:33 sbin/
drwxr-xr-x 2 root root 4096 Jan 14 10:43 srv/
dr-xr-xr-x 13 root root 0 Mar 25 23:58 sys/
drwxrwxrwt 1 root root 4096 Mar 25 23:46 tmp/
drwxr-xr-x 1 root root 4096 Jan 14 10:43 usr/
drwxr-xr-x 1 root root 4096 Jan 14 10:45 var/
drwxr-xr-x 2 root root 4096 Mar 26 01:16 wallet/
root#8e0a63230adf:/# cd home/
root#8e0a63230adf:/home# ll
total 12
drwxr-xr-x 1 root root 4096 Mar 25 23:46 ./
drwxr-xr-x 1 root root 4096 Mar 26 05:24 ../
drwxr-xr-x 3 monero monero 4096 Mar 25 23:46 monero/
root#8e0a63230adf:/home# cd monero/
root#8e0a63230adf:/home/monero# ll
total 12
drwxr-xr-x 3 monero monero 4096 Mar 25 23:46 ./
drwxr-xr-x 1 root root 4096 Mar 25 23:46 ../
drwxr-xr-x 2 root root 4096 Mar 26 01:16 .bitmonero/
root#8e0a63230adf:/home/monero# cd .bitmonero/
root#8e0a63230adf:/home/monero/.bitmonero# ll
total 8
drwxr-xr-x 2 root root 4096 Mar 26 01:16 ./
drwxr-xr-x 3 monero monero 4096 Mar 25 23:46 ../
step 1:
docker run -it -u root --rm -v /srv/monero/chain:/home/monero/.bitmonero -v /srv/monero/wallet:/wallet -v /etc/localtime:/etc/localtime:ro --entrypoint=/bin/chown monero -R monero:monero /home/monero/.bitmonero
step 2:
docker run -itd --restart always --name monero --network net-1 --network-alias monero -v /srv/monero/chain:/home/monero/.bitmonero -v /srv/monero/wallet:/wallet -v /etc/localtime:/etc/localtime:ro --privileged=true monero

GitLab runner cannot write file

As shown below, I tried to write my public key into /root/.ssh/known_hosts in some a shared GitLab runner with the executor of docker using the alpine docker image.
Variable $HOST_FINGERPRINT is initialized which could be proven by the command echo $HOST_FINGERPRINT, but it just cannot be output to the known_hosts file for some reason.
Does anybody have any clue?
$ ls -al
total 32
drwxrwxrwx 2 root root 4096 Jul 11 00:15 .
drwxrwxrwx 8 root root 4096 Jul 11 00:15 ..
-rwxrwxrwx 1 root root 121 Jul 11 00:15 Dockerfile
-rwxrwxrwx 1 root root 183 Jul 11 00:15 known_hosts
$ echo $HOST_FINGERFRINT
xxxxxxxxx, xxxxxxx, ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAG/dWuic73JmrfWPxJkKlW2xXFUJUGkoF2XnPZeVMUE+LF4VU9QXnukuTXFiKCZQGqrnK8UquqSRc3Z/MTBBdo=
$ echo $HOST_FINGERPRINT > known_hosts
$ echo $?
0
$ ls -l .
total 16
-rwxrwxrwx 1 root root 121 Jul 11 00:15 Dockerfile
-rwxrwxrwx 1 root root 1 Jul 11 00:15 known_hosts
$ echo $HOST_FINGERPRINT > known
$ echo $?
0
$ ls -l .
total 24
-rwxrwxrwx 1 root root 121 Jul 11 00:15 Dockerfile
-rw-r--r-- 1 root root 1 Jul 11 00:15 known
-rwxrwxrwx 1 root root 1 Jul 11 00:15 known_hosts

How do I fix ln -s not working in Docker?

Step 3/10 : RUN mkdir -p /etc/nginx/{sites-available,sites-enabled}
Step 4/10 : COPY nginx.conf /etc/nginx/
Step 5/10 : COPY sites-available/*.conf /etc/nginx/sites-available/
Step 6/10 : RUN ln -s /etc/nginx/sites-available/* /etc/nginx/sites-enabled/
---> Running in a2f39a3fd6b3
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
The command '/bin/sh -c ln -s /etc/nginx/sites-available/* /etc/nginx/sites-enabled/*' returned a non-zero code: 1
Any clue why this isn't working? ^^
I tried all these commands outside of a docker container and it seemed to work
This could be solved by copying the files directly to the sites-enabled directory with the following statement:
COPY sites-available/*.conf /etc/nginx/sites-enabled/
Your step 3 includes a bashism:
mkdir -p /etc/nginx/{sites-available,sites-enabled}
With the default /bin/sh, this will create a single directory rather than the two directories you wanted:
$ docker run -it --rm nginx /bin/sh
# ls -al /etc/nginx
total 48
drwxr-xr-x 3 root root 4096 Dec 28 15:20 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
# mkdir -p /etc/nginx/{sites-available,sites-enabled}
# ls -al /etc/nginx
total 56
drwxr-xr-x 1 root root 4096 Jan 26 19:47 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
drwxr-xr-x 2 root root 4096 Jan 26 19:47 {sites-available,sites-enabled}
For /bin/sh, you need to list them individually:
# mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled
# ls -al /etc/nginx
total 64
drwxr-xr-x 1 root root 4096 Jan 26 19:49 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
drwxr-xr-x 2 root root 4096 Jan 26 19:49 sites-available
drwxr-xr-x 2 root root 4096 Jan 26 19:49 sites-enabled
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
drwxr-xr-x 2 root root 4096 Jan 26 19:47 {sites-available,sites-enabled}

Issue with docker-py in executing /bin/bash

I have a docker image built from ubuntu base image with few softwares installed.
i have a startup script, as below
#!/bin/bash
/usr/local/sbin/process1 -d
/usr/local/sbin/process2 -d
/bin/bash
Now I use docker-py python library to start multiple of these containers from a python file.
c = docker.Client(base_url='unix://var/run/docker.sock',
version='1.12',
timeout=10)
container = c.create_container("p12", command="/startup.sh", hostname=None, user=None,
detach=False, stdin_open=False, tty=False, mem_limit=0,
ports=None, environment=None, dns=None, volumes=None,
volumes_from=None, network_disabled=False, name=None,
entrypoint=None, cpu_shares=None, working_dir=None,
memswap_limit=0)
c.start(container, binds=None, port_bindings=None, lxc_conf=None,
publish_all_ports=False, links=None, privileged=False,
dns=None, dns_search=None, volumes_from=None, network_mode=None,
restart_policy=None, cap_add=None, cap_drop=None)
This worked fine and I can start multiple (say 3) when I tested this on a Ubuntu Desktop, Ubuntu 14.04.1 LTS and with docker-py version of 1.10. It will start the dockers and I can do a docker attach later and work on the terminal.
Now i moved my testing environment to a Ubuntu Server edition with Ubuntu 14.04.1 LTS and with docker-py version of 1.12.
The issue i see is that, when I use the same script and try to start 3 dockers, after starting process1 and process 2 as background processes, all the dockers simply exit. It appears as if /bin/bash doesnt execute at all.
If i execute the same docker image as "docker run -t -i p14 /startup.sh --> then everything is fine again. The docker is started appropriately and i get the terminal access.
The only issue is when i execute this python library.
anybody has any similar issues...any idea on how to debug this problem...or any pointers for the fix ?
Thanks,
Kiran
The difference is you're in tty (-t) mode with an open stdin (-i) when you run your docker image with docker run -t -i p14 /startup.sh, whereas you set both stdin_open=False and tty=False in your docker-py configuration.
Because your docker container has no tty and can't take any input from stdin, your call to /bin/bash has nothing to do so exits with code 0.
Try it yourself:
An open stdin with a tty
$ docker run -t -i ubuntu:14.04 /bin/bash
root#1e7eda2bba03:/# ls -la
total 7184
drwxr-xr-x 21 root root 4096 Sep 19 21:30 .
drwxr-xr-x 21 root root 4096 Sep 19 21:30 ..
-rwxr-xr-x 1 root root 0 Sep 19 21:30 .dockerenv
-rwx------ 1 root root 7279686 Jul 21 10:50 .dockerinit
drwxr-xr-x 2 root root 4096 Sep 3 03:33 bin
drwxr-xr-x 2 root root 4096 Apr 10 22:12 boot
drwxr-xr-x 4 root root 360 Sep 19 21:30 dev
drwxr-xr-x 61 root root 4096 Sep 19 21:30 etc
drwxr-xr-x 2 root root 4096 Apr 10 22:12 home
drwxr-xr-x 12 root root 4096 Sep 3 03:33 lib
drwxr-xr-x 2 root root 4096 Sep 3 03:33 lib64
drwxr-xr-x 2 root root 4096 Sep 3 03:33 media
drwxr-xr-x 2 root root 4096 Apr 10 22:12 mnt
drwxr-xr-x 2 root root 4096 Sep 3 03:33 opt
dr-xr-xr-x 240 root root 0 Sep 19 21:30 proc
drwx------ 2 root root 4096 Sep 3 03:33 root
drwxr-xr-x 7 root root 4096 Sep 3 03:33 run
drwxr-xr-x 2 root root 4096 Sep 4 18:41 sbin
drwxr-xr-x 2 root root 4096 Sep 3 03:33 srv
dr-xr-xr-x 13 root root 0 Sep 19 18:44 sys
drwxrwxrwt 2 root root 4096 Sep 4 18:41 tmp
drwxr-xr-x 10 root root 4096 Sep 3 03:33 usr
drwxr-xr-x 11 root root 4096 Sep 3 03:33 var
root#1e7eda2bba03:/#
An open stdin with no tty (i.e., no prompt, but you can still send commands via stdin)
$ docker run -i ubuntu:14.04 /bin/bash
ls -la
total 7184
drwxr-xr-x 21 root root 4096 Sep 19 21:32 .
drwxr-xr-x 21 root root 4096 Sep 19 21:32 ..
-rwxr-xr-x 1 root root 0 Sep 19 21:32 .dockerenv
-rwx------ 1 root root 7279686 Jul 21 10:50 .dockerinit
drwxr-xr-x 2 root root 4096 Sep 3 03:33 bin
drwxr-xr-x 2 root root 4096 Apr 10 22:12 boot
drwxr-xr-x 4 root root 340 Sep 19 21:32 dev
drwxr-xr-x 61 root root 4096 Sep 19 21:32 etc
drwxr-xr-x 2 root root 4096 Apr 10 22:12 home
drwxr-xr-x 12 root root 4096 Sep 3 03:33 lib
drwxr-xr-x 2 root root 4096 Sep 3 03:33 lib64
drwxr-xr-x 2 root root 4096 Sep 3 03:33 media
drwxr-xr-x 2 root root 4096 Apr 10 22:12 mnt
drwxr-xr-x 2 root root 4096 Sep 3 03:33 opt
dr-xr-xr-x 243 root root 0 Sep 19 21:32 proc
drwx------ 2 root root 4096 Sep 3 03:33 root
drwxr-xr-x 7 root root 4096 Sep 3 03:33 run
drwxr-xr-x 2 root root 4096 Sep 4 18:41 sbin
drwxr-xr-x 2 root root 4096 Sep 3 03:33 srv
dr-xr-xr-x 13 root root 0 Sep 19 18:44 sys
drwxrwxrwt 2 root root 4096 Sep 4 18:41 tmp
drwxr-xr-x 10 root root 4096 Sep 3 03:33 usr
drwxr-xr-x 11 root root 4096 Sep 3 03:33 var
A closed stdin with a tty (you can see the prompt but you can't enter any commands)
$ docker run -t ubuntu:14.04 /bin/bash
root#95904c21e5a5:/# ls -la
hello
this does nothing :(
A closed stdin with no tty - /bin/bash has nothing to do
$ docker run ubuntu:14.04 /bin/bash
$

Resources