diff --git a/pkg/provider/handlers/deploy.go b/pkg/provider/handlers/deploy.go index 25b92d2..aa3c0f8 100644 --- a/pkg/provider/handlers/deploy.go +++ b/pkg/provider/handlers/deploy.go @@ -140,10 +140,7 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container memory.Limit = &v } - container, err := client.NewContainer( - ctx, - name, - containerd.WithImage(image), + ctrOps := []containerd.NewContainerOpts{containerd.WithImage(image), containerd.WithSnapshotter(snapshotter), containerd.WithNewSnapshot(name+"-snapshot", image), containerd.WithNewSpec(oci.WithImageConfig(image), @@ -152,7 +149,16 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container oci.WithMounts(mounts), oci.WithEnv(envs), withMemory(memory)), - containerd.WithContainerLabels(labels), + containerd.WithContainerLabels(labels)} + + if v, ok := os.LookupEnv("FUNCTION_RUNTIME"); ok && len(v) > 0 { + ctrOps = append(ctrOps, containerd.WithRuntime(v, nil)) + } + + container, err := client.NewContainer( + ctx, + name, + ctrOps..., ) if err != nil {