Merge pull request #43521 from thaJeztah/rootless_fixups

minor rootless fix-ups
This commit is contained in:
Sebastiaan van Stijn 2022-04-26 11:00:28 +02:00 committed by GitHub
commit 104ac2ca49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 20 deletions

View file

@ -52,11 +52,6 @@ func installConfigFlags(conf *config.Config, flags *pflag.FlagSet) error {
if err != nil {
return errors.Wrapf(err, "running with RootlessKit, but %s not installed", rootless.RootlessKitDockerProxyBinary)
}
configHome, err := homedir.GetConfigHome()
if err == nil {
registry.SetCertsDir(filepath.Join(configHome, "docker/certs.d"))
}
}
flags.StringVar(&conf.BridgeConfig.UserlandProxyPath, "userland-proxy-path", defaultUserlandProxyPath, "Path to the userland proxy binary")
flags.StringVar(&conf.CgroupParent, "cgroup-parent", "", "Set parent cgroup for all containers")

View file

@ -3,29 +3,17 @@ package rootless // import "github.com/docker/docker/rootless"
import (
"os"
"path/filepath"
"sync"
"github.com/pkg/errors"
"github.com/rootless-containers/rootlesskit/pkg/api/client"
)
const (
// RootlessKitDockerProxyBinary is the binary name of rootlesskit-docker-proxy
RootlessKitDockerProxyBinary = "rootlesskit-docker-proxy"
)
var (
runningWithRootlessKit bool
runningWithRootlessKitOnce sync.Once
)
// RootlessKitDockerProxyBinary is the binary name of rootlesskit-docker-proxy
const RootlessKitDockerProxyBinary = "rootlesskit-docker-proxy"
// RunningWithRootlessKit returns true if running under RootlessKit namespaces.
func RunningWithRootlessKit() bool {
runningWithRootlessKitOnce.Do(func() {
u := os.Getenv("ROOTLESSKIT_STATE_DIR")
runningWithRootlessKit = u != ""
})
return runningWithRootlessKit
return os.Getenv("ROOTLESSKIT_STATE_DIR") != ""
}
// GetRootlessKitClient returns RootlessKit client