Restart_once: true ignored if the container is deleted manually

I stacks for with this label set: io.rancher.container.start_once: “true”

When I activate services, the container runs as expected, and is not restarted after it’s done. Unless I go to the containers tab and delete the container that is the “Started-Once” state. When I delete these containers manually, they are restarted immediately. If I stop them, they go back to the “Started-Once” state.

For better clarification, If the parent service is in the Inactive state, the container is not restarted when deleted. If the service is in the “active”, in the API (“Started-Once” in the UI), then the container IS auto-restarted.

Any ideas on how I might set up a container to run one, and only once?

“Once” is once for the lifetime of that container. If you delete a container of an active service, then a replacement is scheduled, and it runs once. If the service is inactive, then nothing happens (until you activate it).