On one particular Ubuntu 18.04 server, my Docker containers are stuck in a restart loop. The restart policy is set to always, which is what I want. Originally, I entertained the idea that the container keeps on restarting due to an error with the config or image. But then I noticed the issue with another container using a different image which was also continuously restarting. The log output for the container I am more concerned with is:
flag provided but not defined: -config
The container is configured using:
sudo docker run -d --name v2ray1 --restart=always -v /etc/v2ray:/etc/v2ray -p 31001:31001 teddysun/v2ray v2ray -config=/etc/v2ray/config1.json
The referenced config1.json file is manually created just prior to running the docker command (through a script using cat). It is correct. It can be read and the contents check out fine.
I have been using the same steps and commands to roll out 10 servers including one just now, without issue. On this one particular server, the container one day decided to quit working without any changes being made (though I just realised all updates are Automatic!). Because I have seen other containers using different images with the same type of issue on this server, and because the same steps/commands work on other servers, the likelihood that the image and/or configuration of my v2ray instance is at fault is low. I suspect a general server problem following a security update.
Things I have tried:
- Updated all packages
- Stopped and deleted all containers
- Deleted images
- Ran the prune command
- Pulled the required image gain
- Recreated containers from scratch
No success, so I:Completely removed docker and purged all mention of it from the system. ThenDid a fresh install of Docker and recreated my container.
The issue persists. No matter what I do, Docker containers crash immediately after starting on this one system. Any suggestions?