Open ericvergnaud opened 1 year ago
Hi @ericvergnaud, what you are describing is the normal behaviour of docker create
.
It'll create a container but not run it: https://docs.docker.com/engine/reference/commandline/create/
Hi, thanks for the feedback, but as described in the bug report, to reproduce you need to Click on the "Start" button, it starts and then stops immediately
That's the abnormal behavior.
Any attempt to actually run the container fails similarly.
Sorry @ericvergnaud, I missed that part. This is also expected.
When you run docker create postgres:12.16
and then click "Start", it'll start a non-interactive
process which is the database itself. This will run in the background and therefore, you'll see the container being up and running.
When you run docker create ubuntu
and then click "Start", you start ubuntu image's default entrypoint, which is /bin/bash
in a non-interactive mode. Because it's not interactive, it'll exit a few milliseconds after it's started.
One way to make the container survive is to create the container in interactive mode. E.g. with docker create -it ubuntu
.
Hope this makes it clearer.
Thanks for the clear explanation, I'll try that. What's strange though is that the same container runs perfectly with docker 3.6. Was this behavior introduced later ?
Thanks for the clear explanation, I'll try that. What's strange though is that the same container runs perfectly with docker 3.6. Was this behavior introduced later ?
The GUI has changed a lot since 3.6. Maybe it did behave differently. Now the GUI behaves exactly like the CLI would.
@dgageot
Thanks for the info. This has also worked for me
docker container run -d -it --name ubuntu --rm ubuntu
Description
When running a container whose image is based on Ubuntu, the container exits almost immediately, without an error message
Reproduce
Expected behavior
The container should run
docker version
docker info
Diagnostics ID
B7B03FAA-10FA-4822-9C79-4698246047CA/20231003004344
Additional Info
Works fine with docker desktop 3.6 Works fine with debian image (for example postgres:12.16)