diff --git a/Makefile b/Makefile index b98424b6c0..054720f921 100644 --- a/Makefile +++ b/Makefile @@ -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 \ diff --git a/api/client/info.go b/api/client/info.go index 06a6f0ec54..918b6bbe7a 100644 --- a/api/client/info.go +++ b/api/client/info.go @@ -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 } diff --git a/api/types/types.go b/api/types/types.go index 56219f845e..457808f5e9 100644 --- a/api/types/types.go +++ b/api/types/types.go @@ -168,6 +168,7 @@ type Info struct { NoProxy string Name string Labels []string + ExperimentalBuild bool } // This struct is a temp struct used by execStart diff --git a/daemon/info.go b/daemon/info.go index 2cd1e5bc65..edec5f9ff7 100644 --- a/daemon/info.go +++ b/daemon/info.go @@ -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 != "" { diff --git a/docker/docker.go b/docker/docker.go index fd40f4b422..84457b177d 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -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 { diff --git a/docs/sources/reference/api/docker_remote_api_v1.19.md b/docs/sources/reference/api/docker_remote_api_v1.19.md index c9b780ea2b..5fec8b811c 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.19.md +++ b/docs/sources/reference/api/docker_remote_api_v1.19.md @@ -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", diff --git a/hack/make.sh b/hack/make.sh index b9c2aef6a8..e43f360e82 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -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 diff --git a/utils/experimental.go b/utils/experimental.go new file mode 100644 index 0000000000..b308a59faf --- /dev/null +++ b/utils/experimental.go @@ -0,0 +1,7 @@ +// +build experimental + +package utils + +func ExperimentalBuild() bool { + return true +} diff --git a/utils/stubs.go b/utils/stubs.go new file mode 100644 index 0000000000..b376f0cfb5 --- /dev/null +++ b/utils/stubs.go @@ -0,0 +1,7 @@ +// +build !experimental + +package utils + +func ExperimentalBuild() bool { + return false +}