Rancher server restart loop


#1

I’m trying to evaluate Rancher 2.1.5 and I’ve hit a snag. I’m using ESXi 6.7 as a platform, and I’ve created a server running RancherOS. After that, I SSH in and run sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:latest -v /opt/rancher:/var/lib/rancher

That appears to work okay, however, a docker ps shows this:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f7076c909706 rancher/rancher:latest "entrypoint.sh -v /o…" 35 seconds ago Restarting (0) 1 second ago awesome_wright

And looking at the logs for the container shows this:

rancher version v2.1.5
rancher version v2.1.5
rancher version v2.1.5
rancher version v2.1.5
rancher version v2.1.5
rancher version v2.1.5
rancher version v2.1.5
rancher version v2.1.5
rancher version v2.1.5
rancher version v2.1.5

Running without the -v argument works properly. How can I fix this and get the server to start properly while keeping the data persistent?


#2

My guess is that /opt/rancher does not exist? You may need to manually create the rancher directory in opt