Hi,
I am learning docker basics right now and stuck on this one.
Version: 19.03.9
Linux ip.compute.internal 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Tue Jan 14 15:50:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
I created a docker container:
docker container run -d -t --name t_d_container linux
fd91f24a79e007d3676b2ab2344b34765829b918672abf4c7995836ad68d0f35
Then executed below:
docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fd91f24a79e0 oraclelinux “/bin/bash” 6 seconds ago Up 5 seconds t_d_container
Then below:
docker container attach t_d_container
[root@fd91f24a79e0 /]# exit
Now the shell doesnot output anything and just sits there for me to press CTRL+C. Why is that?
When i create another container :
docker container run -d -t --name t_d_container1 linux
and attach to it , run exit, it exits from the container and stops it. How can I keep the container running in the background in this scenario?
docker container attach t_d_container1
[root@dv92f24a79e0 /]# exit