Can a host already running docker be added to Rancher?

Can a host that has docker and a container running be added into cattle?

If you properly set it up as a host, then yes.

Thanks MadPipe. My question was a bit vague! We have a coupe of hosts running containers with no problem built using docker-compose, cli etc. Can we retrospectively add this to be orchestrated via Rancher using Cattle? Or do containers need to be added via Rancher in order to be managed?

Apologies if my semantics are off…

Rancher agent get’s started on the host (with the command given to you from Rancher web UI).

Then that agent is registered in Rancher as a Host. The agent is a privileged container that is aware of what containers are running and what’s the state of the docker engine on that machine.

I haven’t tried it, but according to the above, it should see the containers that are already running.

I don’t believe there would be any harm in trying. If you don’t want to try this on a production setup, clone your setup in VMs, and test it there.

Nice one - thanks for the info!

In my experience what you will see is that the existing containers will show up on the Infrastructure|Host tab in the Rancher UI, but they won’t be anywhere in the Stacks tab (obviously they weren’t part of a rancher managed stack

1 Like

Thanks John, that makes sense…