As a result I can't seem to start it or attach to it:
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
17d34ecd8c24 ubuntu:latest "bash" 2 hours ago Exited (-1) 27 minutes ago fervent_kowalevski
...
$ sudo docker start 17d34ecd8c24
Error response from daemon: Cannot start container 17d34ecd8c24: [8] System error: Unit docker-17d34ecd8c24ffcc9392735710b56ee9bab1cc62237f152114017fe6f92c3fcb.scope already exists.
FATA[0000] Error: failed to start one or more containers
$ sudo docker attach 17d34ecd8c24
FATA[0000] You cannot attach to a stopped container, start it first
Is there anything I can do to fix it?
Could this be related to https://github.com/docker/docker/issues/7015? Check out comment https://github.com/docker/docker/issues/7015#issuecomment-52522196 for a workaround.
For your particular error, you would do something like:
$ systemctl stop docker-17d34ecd8c24ffcc9392735710b56ee9bab1cc62237f152114017fe6f92c3fcb.scope
Then try to start the container again. However, if you were running this container as a bash shell interactively, you won't be able to start it and then attach to it, as the shell will immediately exit. You will need to add -a
(attach) and -i
(interactive) to the docker start
command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With