Welcome to the Linux Foundation Forum!

Lab 6.2: Detached by default?


I am going through Lab 6.2. I used the separate commands create and start to start the alpine container. I see that by default the container is running detached. I then use the "run" command to run another alpine container. This container starts up as attached.

From reading online, I know there is a difference between the "start" command and the "run" command but people also say that "run" is a combination of "create" and "start". Since the command options for "run" and "start" both specified running the bash command and in both cases I was starting with containers that were not yet running, I expected both containers to be attached (or both containers to be detached). It was surprising the in one case the container was detached and in the other it was attached. Why is there a difference in the behavior?

For reference I am using the Ubuntu VM specified for the course and I ran the commands as-is from the lab.



Upcoming Training