Add DOCKER_EXPERIMENTAL environment variable

The DOCKER_EXPERIMENTAL environment variable drives the activation of
the 'experimental' build tag.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
This commit is contained in:
Arnaud Porterie 2015-05-19 15:09:58 -07:00
parent 0cc5da0635
commit ca6722f1c5
9 changed files with 30 additions and 0 deletions

View File

@ -7,6 +7,7 @@ DOCKER_ENVS := \
-e BUILDFLAGS \
-e DOCKER_CLIENTONLY \
-e DOCKER_EXECDRIVER \
-e DOCKER_EXPERIMENTAL \
-e DOCKER_GRAPHDRIVER \
-e DOCKER_STORAGE_OPTS \
-e TESTDIRS \

View File

@ -87,6 +87,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
fmt.Fprintf(cli.out, " %s\n", attribute)
}
}
fmt.Fprintf(cli.out, "Experimental: %t\n", info.ExperimentalBuild)
return nil
}

View File

@ -168,6 +168,7 @@ type Info struct {
NoProxy string
Name string
Labels []string
ExperimentalBuild bool
}
// This struct is a temp struct used by execStart

View File

@ -85,6 +85,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
MemTotal: meminfo.MemTotal,
DockerRootDir: daemon.Config().Root,
Labels: daemon.Config().Labels,
ExperimentalBuild: utils.ExperimentalBuild(),
}
if httpProxy := os.Getenv("http_proxy"); httpProxy != "" {

View File

@ -16,6 +16,7 @@ import (
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/docker/docker/utils"
)
const (
@ -59,6 +60,10 @@ func main() {
setLogLevel(logrus.DebugLevel)
}
if utils.ExperimentalBuild() {
logrus.Warn("Running experimental build")
}
if len(flHosts) == 0 {
defaultHost := os.Getenv("DOCKER_HOST")
if defaultHost == "" || *flDaemon {

View File

@ -1620,6 +1620,7 @@ Display system-wide information
"Driver": "btrfs",
"DriverStatus": [[""]],
"ExecutionDriver": "native-0.1",
"ExperimentalBuild": false,
"HttpProxy": "http://test:test@localhost:8080",
"HttpsProxy": "https://test:test@localhost:8080",
"ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS",

View File

@ -93,6 +93,12 @@ if [ ! "$GOPATH" ]; then
exit 1
fi
if [ "$DOCKER_EXPERIMENTAL" ]; then
echo >&2 '# WARNING! DOCKER_EXPERIMENTAL is set: building experimental features'
echo >&2
DOCKER_BUILDTAGS+=" experimental"
fi
if [ -z "$DOCKER_CLIENTONLY" ]; then
DOCKER_BUILDTAGS+=" daemon"
fi

7
utils/experimental.go Normal file
View File

@ -0,0 +1,7 @@
// +build experimental
package utils
func ExperimentalBuild() bool {
return true
}

7
utils/stubs.go Normal file
View File

@ -0,0 +1,7 @@
// +build !experimental
package utils
func ExperimentalBuild() bool {
return false
}