This commit is contained in:
d513 2023-10-12 17:29:51 +08:00 committed by GitHub
commit 5624b0b3f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"os"
"strings" "strings"
"time" "time"
@ -266,6 +267,15 @@ func (client dockerClient) StartContainer(c t.Container) (t.ContainerID, error)
name := c.Name() 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) log.Infof("Creating %s", name)
createdContainer, err := client.api.ContainerCreate(bg, config, hostConfig, simpleNetworkConfig, nil, name) createdContainer, err := client.api.ContainerCreate(bg, config, hostConfig, simpleNetworkConfig, nil, name)