Run a docker build on an EC2 instance (let’s say the docker build hangs)
Reboot EC2 instance
After the instance reboots, whenever I try to run ANY docker command (e.g., docker info), it just hangs and doesn’t return.
I tried to restart docker, but same problem. I tried to uninstall docker (yum remove docker) and remove /var/lib/docker and reinstall, but even then it still hangs. I have to delete the EC2 instance and start all over again. How do I fix this?
You will receive an error when you run the docker run at first try:
Error response from daemon: invalid header field value "oci runtime error: container with id exists: 7a244b8f5d07081538042ff64aebfe11fac1a36731526e77be53db7d94dca44d\n"
Error: failed to start containers:
Try running docker start command again. You will have your container up and running magically without any errors.