mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 07:00:13 +01:00
Add podman support
This commit is contained in:
parent
d2cfefb08a
commit
ae0e308e81
1 changed files with 10 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue