Terminate template containers before delting a layer Upstream-commit: 70b53c932dbc757c44ae7b18ad122b043fb82530 Component: engine