mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
Merge ae0e308e81
into 8aa41b8101
This commit is contained in:
commit
5624b0b3f8
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue