Here is another question from a Docker newbie. I currently run my Docker image in "debugging mode" with bash
so that I can docker attach
to the running instance to enter a shell where I can inspect the application’s OS environment, etc., at runtime.
docker run <image-id> -d -it bash -c “<start application in background>; bash”
I am wondering whether I should have bash
always included, i.e. change the CMD
inside Dockerfile
from CMD <start application in foreground>
to CMD <start application in background>; bash
.
Would this be inappropriate in "production mode"
for security reasons -- Who is allowed to attach to a running instance?,
in light of Docker being an application isolation tool, not an OS virtualization tool,
for other reasons?