summaryrefslogtreecommitdiff
path: root/oci
diff options
context:
space:
mode:
authorSebastiaan van Stijn <thaJeztah@users.noreply.github.com>2022-12-16 15:25:41 +0100
committerGitHub <noreply@github.com>2022-12-16 15:25:41 +0100
commit6371675bf9de2f38735db36ebe73fba5c9078ffb (patch)
treebd444805319ca2ccb431e39338c819c076c0cb64 /oci
parentb10de9186ced20bed098592b72e7786349281cbf (diff)
parentfb7797320148efb84fc8ddade741a9ba27efd82c (diff)
downloaddocker-6371675bf9de2f38735db36ebe73fba5c9078ffb.tar.gz
Merge pull request #44275 from thaJeztah/move_pkg_system_funcs
pkg/system: move some functions to a new home
Diffstat (limited to 'oci')
-rw-r--r--oci/defaults.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/oci/defaults.go b/oci/defaults.go
index b79892ddc2..03afad4c62 100644
--- a/oci/defaults.go
+++ b/oci/defaults.go
@@ -9,6 +9,24 @@ import (
func iPtr(i int64) *int64 { return &i }
+const defaultUnixPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
+// DefaultPathEnv is unix style list of directories to search for
+// executables. Each directory is separated from the next by a colon
+// ':' character .
+// For Windows containers, an empty string is returned as the default
+// path will be set by the container, and Docker has no context of what the
+// default path should be.
+//
+// TODO(thaJeztah) align Windows default with BuildKit; see https://github.com/moby/buildkit/pull/1747
+// TODO(thaJeztah) use defaults from containerd (but align it with BuildKit; see https://github.com/moby/buildkit/pull/1747)
+func DefaultPathEnv(os string) string {
+ if os == "windows" {
+ return ""
+ }
+ return defaultUnixPathEnv
+}
+
// DefaultSpec returns the default spec used by docker for the current Platform
func DefaultSpec() specs.Spec {
if runtime.GOOS == "windows" {