Quantcast
Channel: User g.pickardou - Super User
Viewing all articles
Browse latest Browse all 33

Why container terminates, despite I have an interactive docker exec command running?

$
0
0

I have the following container which I've created using the following command:

docker container create --name="my-service" ubuntu:latest sleep 120

When I start docker container start my-service this container it runs, then exits after 120 seconds, all OK.

Now in a second experiment I start the container, and while it runs I execute:

docker exec -ti my-service /bin/bash

Question

After 120 seconds the interactive bash terminates, because the container itself terminates. Why, and what is exactly the docker engine logic to doing this?


Viewing all articles
Browse latest Browse all 33

Trending Articles