mirror of https://github.com/docker/docs.git
Allow packagers to specify a custom dockerinit lookup location via DOCKER_INITPATH in dynbinary
Only necessary if distro policy dictates that the path deviate from the paths already listed in utils/utils.go - please refrain from using it otherwise.
This commit is contained in:
parent
f02d766f9a
commit
2ed1001c57
|
@ -12,6 +12,6 @@ export DOCKER_INITSHA1="$(sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)"
|
||||||
# exported so that "dyntest" can easily access it later without recalculating it
|
# exported so that "dyntest" can easily access it later without recalculating it
|
||||||
|
|
||||||
(
|
(
|
||||||
export LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\""
|
export LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\" -X github.com/dotcloud/docker/utils.INITPATH \"$DOCKER_INITPATH\""
|
||||||
source "$(dirname "$BASH_SOURCE")/binary"
|
source "$(dirname "$BASH_SOURCE")/binary"
|
||||||
)
|
)
|
||||||
|
|
|
@ -26,6 +26,7 @@ import (
|
||||||
var (
|
var (
|
||||||
IAMSTATIC bool // whether or not Docker itself was compiled statically via ./hack/make.sh binary
|
IAMSTATIC bool // whether or not Docker itself was compiled statically via ./hack/make.sh binary
|
||||||
INITSHA1 string // sha1sum of separate static dockerinit, if Docker itself was compiled dynamically via ./hack/make.sh dynbinary
|
INITSHA1 string // sha1sum of separate static dockerinit, if Docker itself was compiled dynamically via ./hack/make.sh dynbinary
|
||||||
|
INITPATH string // custom location to search for a valid dockerinit binary (available for packagers as a last resort escape hatch)
|
||||||
)
|
)
|
||||||
|
|
||||||
// A common interface to access the Fatal method of
|
// A common interface to access the Fatal method of
|
||||||
|
@ -231,6 +232,7 @@ func DockerInitPath(localCopy string) string {
|
||||||
}
|
}
|
||||||
var possibleInits = []string{
|
var possibleInits = []string{
|
||||||
localCopy,
|
localCopy,
|
||||||
|
INITPATH,
|
||||||
filepath.Join(filepath.Dir(selfPath), "dockerinit"),
|
filepath.Join(filepath.Dir(selfPath), "dockerinit"),
|
||||||
|
|
||||||
// FHS 3.0 Draft: "/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/libexec."
|
// FHS 3.0 Draft: "/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/libexec."
|
||||||
|
|
Loading…
Reference in New Issue