From ae0e308e81db5f08a1b6948373eab715e67b77ce Mon Sep 17 00:00:00 2001 From: dada513 Date: Fri, 16 Dec 2022 13:13:13 +0100 Subject: [PATCH] Add podman support --- pkg/container/client.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/container/client.go b/pkg/container/client.go index 7447828b1..5fa744d26 100644 --- a/pkg/container/client.go +++ b/pkg/container/client.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "io/ioutil" + "os" "strings" "time" @@ -227,6 +228,15 @@ func (client dockerClient) StartContainer(c Container) (t.ContainerID, error) { name := c.Name() + // detect podman + // podman makes /run/.containerenv, docker makes /run/.dockerenv + _, err := os.Stat("/run/.containerenv") + if err == nil { + // podman workaround + name = name[1:] + hostConfig.Ulimits = nil + } + log.Infof("Creating %s", name) createdContainer, err := client.api.ContainerCreate(bg, config, hostConfig, simpleNetworkConfig, nil, name) if err != nil {