I have an orphan container which I can't remove

I have a container that was started with rancher-compose but it’s got itself in an orphan state. It no longer appears in the applications page but is still present (and repeatedly failing to start) in the infrastructure page. I can’t seem to get rid of it at all. If I stop it using docker or the UI from the infrastructure page it just keeps coming back. I’ve even gone as far as restarting the docker host but without success. Where should I be looking to remove it completely?

If you can try to click on the “view in API” for the container failing to start, you could click on the “Services” link to get the related service.

Check the state of the service (not the container). It is most likely in Active state. If you can “Delete” the service, that will stop Rancher from attempting to keep the containers in your service. It will move the service into Removed state and containers won’t continue to launch.

Thanks Denise that worked a treat. If I understand correctly Cattle still knew that the service was active and kept restarting it (it had boot issues) but because it was no longer related to a stack then the UI couldn’t see it. Makes sense. Must play about more with the API.