This package is used internally by the daemon, and was only used out
side of the daemon by pkg/plugins (for which we still need to look
where it should be kept).
Making it internal because it's trivial to implement if needed by
anyone. The only reason it's a package is to keep it central, and
to make it easier to discover where we have rootlesskit-specific
codepaths in our codebase.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -29,6 +29,7 @@ import ( |
| 29 | 29 |
"github.com/docker/docker/daemon/internal/builder-next/exporter" |
| 30 | 30 |
"github.com/docker/docker/daemon/internal/libcontainerd/supervisor" |
| 31 | 31 |
"github.com/docker/docker/daemon/internal/otelutil" |
| 32 |
+ "github.com/docker/docker/daemon/internal/rootless" |
|
| 32 | 33 |
"github.com/docker/docker/daemon/listeners" |
| 33 | 34 |
dopts "github.com/docker/docker/daemon/pkg/opts" |
| 34 | 35 |
"github.com/docker/docker/daemon/pkg/plugin" |
| ... | ... |
@@ -53,7 +54,6 @@ import ( |
| 53 | 53 |
"github.com/docker/docker/pkg/homedir" |
| 54 | 54 |
"github.com/docker/docker/pkg/pidfile" |
| 55 | 55 |
"github.com/docker/docker/pkg/plugingetter" |
| 56 |
- "github.com/docker/docker/pkg/rootless" |
|
| 57 | 56 |
"github.com/docker/go-connections/tlsconfig" |
| 58 | 57 |
"github.com/moby/buildkit/session" |
| 59 | 58 |
"github.com/moby/buildkit/util/tracing/detect" |
| ... | ... |
@@ -7,8 +7,8 @@ import ( |
| 7 | 7 |
|
| 8 | 8 |
"github.com/containerd/log" |
| 9 | 9 |
"github.com/docker/docker/daemon/config" |
| 10 |
+ "github.com/docker/docker/daemon/internal/rootless" |
|
| 10 | 11 |
"github.com/docker/docker/dockerversion" |
| 11 |
- "github.com/docker/docker/pkg/rootless" |
|
| 12 | 12 |
"github.com/moby/buildkit/util/apicaps" |
| 13 | 13 |
"github.com/spf13/cobra" |
| 14 | 14 |
) |
| ... | ... |
@@ -11,10 +11,10 @@ import ( |
| 11 | 11 |
|
| 12 | 12 |
"github.com/containerd/cgroups/v3" |
| 13 | 13 |
"github.com/containerd/log" |
| 14 |
+ "github.com/docker/docker/daemon/internal/rootless" |
|
| 14 | 15 |
"github.com/docker/docker/daemon/libnetwork/drivers/bridge" |
| 15 | 16 |
"github.com/docker/docker/daemon/pkg/opts" |
| 16 | 17 |
"github.com/docker/docker/pkg/homedir" |
| 17 |
- "github.com/docker/docker/pkg/rootless" |
|
| 18 | 18 |
"github.com/moby/moby/api/types/container" |
| 19 | 19 |
"github.com/moby/moby/api/types/system" |
| 20 | 20 |
"github.com/pkg/errors" |
| ... | ... |
@@ -14,7 +14,7 @@ import ( |
| 14 | 14 |
runcoptions "github.com/containerd/containerd/api/types/runc/options" |
| 15 | 15 |
"github.com/containerd/log" |
| 16 | 16 |
"github.com/docker/docker/daemon/config" |
| 17 |
- "github.com/docker/docker/pkg/rootless" |
|
| 17 |
+ "github.com/docker/docker/daemon/internal/rootless" |
|
| 18 | 18 |
"github.com/docker/docker/pkg/sysinfo" |
| 19 | 19 |
"github.com/moby/moby/api/types" |
| 20 | 20 |
containertypes "github.com/moby/moby/api/types/container" |
| ... | ... |
@@ -3,10 +3,10 @@ |
| 3 | 3 |
package plugins |
| 4 | 4 |
|
| 5 | 5 |
import ( |
| 6 |
+ "os" |
|
| 6 | 7 |
"path/filepath" |
| 7 | 8 |
|
| 8 | 9 |
"github.com/docker/docker/pkg/homedir" |
| 9 |
- "github.com/docker/docker/pkg/rootless" |
|
| 10 | 10 |
) |
| 11 | 11 |
|
| 12 | 12 |
func rootlessConfigPluginsPath() string {
|
| ... | ... |
@@ -25,7 +25,8 @@ func rootlessLibPluginsPath() string {
|
| 25 | 25 |
|
| 26 | 26 |
// specsPaths is the non-Windows implementation of [SpecsPaths]. |
| 27 | 27 |
func specsPaths() []string {
|
| 28 |
- if rootless.RunningWithRootlessKit() {
|
|
| 28 |
+ // TODO(thaJeztah): switch back to daemon/internal/rootless.RunningWithRootlessKit if this package moves internal to the daemon. |
|
| 29 |
+ if os.Getenv("ROOTLESSKIT_STATE_DIR") != "" {
|
|
| 29 | 30 |
return []string{rootlessConfigPluginsPath(), rootlessLibPluginsPath()}
|
| 30 | 31 |
} |
| 31 | 32 |
return []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"}
|