I m aware of the docker run
command to start an existing image as a container in the background.
G:\>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
todoapp latest 79fa51e9ccbb 4 hours ago 956MB
G:\>docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b74e0eafc4ce todoapp "docker-entrypoint.s…" 4 hours ago Exited (1) 4 hours ago example1
docker run -d -it -p 8000:8000 --name example1 todoapp
However, because the image is already build I now get this error.
G:\>docker run -d -it -p 8000:8000 --name example1 todoapp
docker: Error response from daemon: Conflict. The container name "/example1" is already in use by container "b74e0eafc4ce1eabef8ac0eeb041d8d14dce679273c98f88db5c9e2657422e95". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
Without needing to build the image again or deleting the image using rm
I would like to simply start the docker container for this image in the background.
I however, did not find any option of sending the container to the background using docker start
.
Can you please suggest?