Răsfoiți Sursa

load a predefined PATH if it wasn't provided in runtime

Gorka Lerchundi Osa 10 ani în urmă
părinte
comite
88b1330b33
2 a modificat fișierele cu 10 adăugiri și 11 ștergeri
  1. 0 11
      builder/overlay-rootfs/etc/s6/init/init-stage1
  2. 10 0
      builder/overlay-rootfs/init

+ 0 - 11
builder/overlay-rootfs/etc/s6/init/init-stage1

@@ -1,16 +1,5 @@
 #!/bin/execlineb -S0
 
-##
-## we add /usr/bin:/bin to PATH at least for the very first init-stage1 steps,
-## this was motivated due to this issue:
-## - https://github.com/just-containers/s6-overlay/issues/108
-## although this change we'll keep how stages envs are handled, see below.
-##
-
-/bin/export PATH /usr/bin:/bin
-/bin/import PATH
-
-
 ##
 ## dump environment into an envdir
 ##

+ 10 - 0
builder/overlay-rootfs/init

@@ -1,2 +1,12 @@
 #!/bin/execlineb -S0
+
+##
+## load default PATH (the same that Docker includes if not provided) if it doesn't exist,
+## then go ahead with stage1.
+## this was motivated due to this issue:
+## - https://github.com/just-containers/s6-overlay/issues/108
+##
+
+
+/bin/importas -D /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH PATH
 /etc/s6/init/init-stage1 $@