If I use docker container run ubuntu to run a container directly from an Ubuntu image, I can easily restart it using docker start CONTAINER_ID. When I run the container using the image using docker run ID_IMAGE, however, it is completely gone as I quit the pseudo-terminal.
When I tried to restart it, I observed that the status changed, indicating that the primary process starts and then ends. Do you have any ideas?
portaivan@training-vm:~$ docker image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest d70eaf7277ea 8 days ago 72.9MB
portaivan@training-vm:~$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4004895feff9 d70eaf7277ea "/bin/bash" 3 hours ago Exited (0) 3 hours ago heuristic_lovelace
3b1b521d62aa ubuntu "/bin/bash" 3 hours ago Exited (0) 23 seconds ago sleepy_pike
portaivan@training-vm:~$ docker start 3b1b521d62aa
3b1b521d62aa
portaivan@training-vm:~$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4004895feff9 d70eaf7277ea "/bin/bash" 3 hours ago Exited (0) 3 hours ago heuristic_lovelace
3b1b521d62aa ubuntu "/bin/bash" 3 hours ago Up 2 seconds sleepy_pike
portaivan@training-vm:~$ docker container start 4004895feff9
4004895feff9
portaivan@training-vm:~$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4004895feff9 d70eaf7277ea "/bin/bash" 3 hours ago Exited (0) 2 seconds ago heuristic_lovelace
3b1b521d62aa ubuntu "/bin/bash" 3 hours ago Up 17 seconds sleepy_pike
portaivan@training-vm:~$ docker container start -i 4004895feff9
portaivan@training-vm:~$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4004895feff9 d70eaf7277ea "/bin/bash" 3 hours ago Exited (0) 2 seconds ago heuristic_lovelace
3b1b521d62aa ubuntu "/bin/bash" 3 hours ago Up 28 seconds sleepy_pike