mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Merge pull request #17423 from cpuguy83/so_sensitive
Revert "dockerversion placeholder for library-import"
This commit is contained in:
		
						commit
						b227d19cae
					
				
					 21 changed files with 51 additions and 71 deletions
				
			
		
							
								
								
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -36,4 +36,3 @@ man/man5
 | 
			
		|||
man/man8
 | 
			
		||||
pyenv
 | 
			
		||||
vendor/pkg/
 | 
			
		||||
version/version_autogen.go
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,9 +15,9 @@ import (
 | 
			
		|||
 | 
			
		||||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/docker/api"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/pkg/stdcopy"
 | 
			
		||||
	"github.com/docker/docker/pkg/term"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type tlsClientCon struct {
 | 
			
		||||
| 
						 | 
				
			
			@ -152,7 +152,7 @@ func (cli *DockerCli) hijackWithContentType(method, path, contentType string, se
 | 
			
		|||
		req.Header.Set(k, v)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	req.Header.Set("User-Agent", "Docker-Client/"+version.VERSION+" ("+runtime.GOOS+")")
 | 
			
		||||
	req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION+" ("+runtime.GOOS+")")
 | 
			
		||||
	req.Header.Set("Content-Type", contentType)
 | 
			
		||||
	req.Header.Set("Connection", "Upgrade")
 | 
			
		||||
	req.Header.Set("Upgrade", "tcp")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,6 +20,7 @@ import (
 | 
			
		|||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/docker/api"
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/cliconfig"
 | 
			
		||||
	"github.com/docker/docker/pkg/jsonmessage"
 | 
			
		||||
	"github.com/docker/docker/pkg/signal"
 | 
			
		||||
| 
						 | 
				
			
			@ -27,7 +28,6 @@ import (
 | 
			
		|||
	"github.com/docker/docker/pkg/term"
 | 
			
		||||
	"github.com/docker/docker/registry"
 | 
			
		||||
	"github.com/docker/docker/utils"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
| 
						 | 
				
			
			@ -77,7 +77,7 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m
 | 
			
		|||
		req.Header.Set(k, v)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	req.Header.Set("User-Agent", "Docker-Client/"+version.VERSION+" ("+runtime.GOOS+")")
 | 
			
		||||
	req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION+" ("+runtime.GOOS+")")
 | 
			
		||||
	req.URL.Host = cli.addr
 | 
			
		||||
	req.URL.Scheme = cli.scheme
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,10 +7,10 @@ import (
 | 
			
		|||
 | 
			
		||||
	"github.com/docker/docker/api"
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	Cli "github.com/docker/docker/cli"
 | 
			
		||||
	flag "github.com/docker/docker/pkg/mflag"
 | 
			
		||||
	"github.com/docker/docker/utils"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var versionTemplate = `Client:
 | 
			
		||||
| 
						 | 
				
			
			@ -60,11 +60,11 @@ func (cli *DockerCli) CmdVersion(args ...string) (err error) {
 | 
			
		|||
 | 
			
		||||
	vd := versionData{
 | 
			
		||||
		Client: types.Version{
 | 
			
		||||
			Version:      version.VERSION,
 | 
			
		||||
			Version:      dockerversion.VERSION,
 | 
			
		||||
			APIVersion:   api.Version,
 | 
			
		||||
			GoVersion:    runtime.Version(),
 | 
			
		||||
			GitCommit:    version.GITCOMMIT,
 | 
			
		||||
			BuildTime:    version.BUILDTIME,
 | 
			
		||||
			GitCommit:    dockerversion.GITCOMMIT,
 | 
			
		||||
			BuildTime:    dockerversion.BUILDTIME,
 | 
			
		||||
			Os:           runtime.GOOS,
 | 
			
		||||
			Arch:         runtime.GOARCH,
 | 
			
		||||
			Experimental: utils.ExperimentalBuild(),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,9 +11,9 @@ import (
 | 
			
		|||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/docker/api"
 | 
			
		||||
	"github.com/docker/docker/api/server/httputils"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/errors"
 | 
			
		||||
	"github.com/docker/docker/pkg/version"
 | 
			
		||||
	dockerversion "github.com/docker/docker/version"
 | 
			
		||||
	"golang.org/x/net/context"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,24 +10,24 @@ import (
 | 
			
		|||
	"github.com/docker/docker/api"
 | 
			
		||||
	"github.com/docker/docker/api/server/httputils"
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/pkg/ioutils"
 | 
			
		||||
	"github.com/docker/docker/pkg/jsonmessage"
 | 
			
		||||
	"github.com/docker/docker/pkg/parsers/filters"
 | 
			
		||||
	"github.com/docker/docker/pkg/parsers/kernel"
 | 
			
		||||
	"github.com/docker/docker/utils"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
	"golang.org/x/net/context"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func (s *router) getVersion(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
 | 
			
		||||
	v := &types.Version{
 | 
			
		||||
		Version:    version.VERSION,
 | 
			
		||||
		Version:    dockerversion.VERSION,
 | 
			
		||||
		APIVersion: api.Version,
 | 
			
		||||
		GitCommit:  version.GITCOMMIT,
 | 
			
		||||
		GitCommit:  dockerversion.GITCOMMIT,
 | 
			
		||||
		GoVersion:  runtime.Version(),
 | 
			
		||||
		Os:         runtime.GOOS,
 | 
			
		||||
		Arch:       runtime.GOARCH,
 | 
			
		||||
		BuildTime:  version.BUILDTIME,
 | 
			
		||||
		BuildTime:  dockerversion.BUILDTIME,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	version := httputils.VersionFromContext(ctx)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,6 +12,7 @@ import (
 | 
			
		|||
	"syscall"
 | 
			
		||||
 | 
			
		||||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/daemon/graphdriver"
 | 
			
		||||
	derr "github.com/docker/docker/errors"
 | 
			
		||||
	"github.com/docker/docker/pkg/fileutils"
 | 
			
		||||
| 
						 | 
				
			
			@ -21,7 +22,6 @@ import (
 | 
			
		|||
	"github.com/docker/docker/pkg/sysinfo"
 | 
			
		||||
	"github.com/docker/docker/runconfig"
 | 
			
		||||
	"github.com/docker/docker/utils"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
	"github.com/docker/docker/volume"
 | 
			
		||||
	"github.com/docker/libnetwork"
 | 
			
		||||
	nwconfig "github.com/docker/libnetwork/config"
 | 
			
		||||
| 
						 | 
				
			
			@ -286,7 +286,7 @@ func migrateIfDownlevel(driver graphdriver.Driver, root string) error {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
func configureSysInit(config *Config, rootUID, rootGID int) (string, error) {
 | 
			
		||||
	localCopy := filepath.Join(config.Root, "init", fmt.Sprintf("dockerinit-%s", version.VERSION))
 | 
			
		||||
	localCopy := filepath.Join(config.Root, "init", fmt.Sprintf("dockerinit-%s", dockerversion.VERSION))
 | 
			
		||||
	sysInitPath := utils.DockerInitPath(localCopy)
 | 
			
		||||
	if sysInitPath == "" {
 | 
			
		||||
		return "", fmt.Errorf("Could not locate dockerinit: This usually means docker was built incorrectly. See https://docs.docker.com/project/set-up-dev-env/ for official build instructions.")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,9 +8,9 @@ import (
 | 
			
		|||
	"sync"
 | 
			
		||||
 | 
			
		||||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/daemon/execdriver"
 | 
			
		||||
	"github.com/docker/docker/pkg/parsers"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// This is a daemon development variable only and should not be
 | 
			
		||||
| 
						 | 
				
			
			@ -24,7 +24,7 @@ var forceKill bool
 | 
			
		|||
// Define name and version for windows
 | 
			
		||||
var (
 | 
			
		||||
	DriverName = "Windows 1854"
 | 
			
		||||
	Version    = version.VERSION + " " + version.GITCOMMIT
 | 
			
		||||
	Version    = dockerversion.VERSION + " " + dockerversion.GITCOMMIT
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type activeContainer struct {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,6 +16,7 @@ import (
 | 
			
		|||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/daemon/graphdriver"
 | 
			
		||||
	"github.com/docker/docker/image"
 | 
			
		||||
	"github.com/docker/docker/pkg/archive"
 | 
			
		||||
| 
						 | 
				
			
			@ -23,7 +24,6 @@ import (
 | 
			
		|||
	"github.com/docker/docker/pkg/idtools"
 | 
			
		||||
	"github.com/docker/docker/pkg/ioutils"
 | 
			
		||||
	"github.com/docker/docker/pkg/random"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
	"github.com/microsoft/hcsshim"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -440,7 +440,7 @@ func (d *Driver) RestoreCustomImages(tagger graphdriver.Tagger, recorder graphdr
 | 
			
		|||
			img := &image.Image{
 | 
			
		||||
				ID:            id,
 | 
			
		||||
				Created:       imageData.CreatedTime,
 | 
			
		||||
				DockerVersion: version.VERSION,
 | 
			
		||||
				DockerVersion: dockerversion.VERSION,
 | 
			
		||||
				Architecture:  runtime.GOARCH,
 | 
			
		||||
				OS:            runtime.GOOS,
 | 
			
		||||
				Size:          imageData.Size,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,7 @@ import (
 | 
			
		|||
 | 
			
		||||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/pkg/fileutils"
 | 
			
		||||
	"github.com/docker/docker/pkg/parsers/kernel"
 | 
			
		||||
	"github.com/docker/docker/pkg/parsers/operatingsystem"
 | 
			
		||||
| 
						 | 
				
			
			@ -14,7 +15,6 @@ import (
 | 
			
		|||
	"github.com/docker/docker/pkg/system"
 | 
			
		||||
	"github.com/docker/docker/registry"
 | 
			
		||||
	"github.com/docker/docker/utils"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// SystemInfo returns information about the host server the daemon is running on.
 | 
			
		||||
| 
						 | 
				
			
			@ -83,14 +83,14 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
 | 
			
		|||
		OperatingSystem:    operatingSystem,
 | 
			
		||||
		IndexServerAddress: registry.IndexServer,
 | 
			
		||||
		RegistryConfig:     daemon.RegistryService.Config,
 | 
			
		||||
		InitSha1:           version.INITSHA1,
 | 
			
		||||
		InitSha1:           dockerversion.INITSHA1,
 | 
			
		||||
		InitPath:           initPath,
 | 
			
		||||
		NCPU:               runtime.NumCPU(),
 | 
			
		||||
		MemTotal:           meminfo.MemTotal,
 | 
			
		||||
		DockerRootDir:      daemon.config().Root,
 | 
			
		||||
		Labels:             daemon.config().Labels,
 | 
			
		||||
		ExperimentalBuild:  utils.ExperimentalBuild(),
 | 
			
		||||
		ServerVersion:      version.VERSION,
 | 
			
		||||
		ServerVersion:      dockerversion.VERSION,
 | 
			
		||||
		ClusterStore:       daemon.config().ClusterStore,
 | 
			
		||||
		ClusterAdvertise:   daemon.config().ClusterAdvertise,
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,6 +14,7 @@ import (
 | 
			
		|||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/distribution/uuid"
 | 
			
		||||
	apiserver "github.com/docker/docker/api/server"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/cli"
 | 
			
		||||
	"github.com/docker/docker/cliconfig"
 | 
			
		||||
	"github.com/docker/docker/daemon"
 | 
			
		||||
| 
						 | 
				
			
			@ -27,7 +28,6 @@ import (
 | 
			
		|||
	"github.com/docker/docker/pkg/tlsconfig"
 | 
			
		||||
	"github.com/docker/docker/registry"
 | 
			
		||||
	"github.com/docker/docker/utils"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const daemonUsage = "       docker daemon [ --help | ... ]\n"
 | 
			
		||||
| 
						 | 
				
			
			@ -206,7 +206,7 @@ func (cli *DaemonCli) CmdDaemon(args ...string) error {
 | 
			
		|||
 | 
			
		||||
	serverConfig := &apiserver.Config{
 | 
			
		||||
		Logging: true,
 | 
			
		||||
		Version: version.VERSION,
 | 
			
		||||
		Version: dockerversion.VERSION,
 | 
			
		||||
	}
 | 
			
		||||
	serverConfig = setPlatformServerConfig(serverConfig, cli.Config)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -279,8 +279,8 @@ func (cli *DaemonCli) CmdDaemon(args ...string) error {
 | 
			
		|||
	logrus.Info("Daemon has completed initialization")
 | 
			
		||||
 | 
			
		||||
	logrus.WithFields(logrus.Fields{
 | 
			
		||||
		"version":     version.VERSION,
 | 
			
		||||
		"commit":      version.GITCOMMIT,
 | 
			
		||||
		"version":     dockerversion.VERSION,
 | 
			
		||||
		"commit":      dockerversion.GITCOMMIT,
 | 
			
		||||
		"execdriver":  d.ExecutionDriver().Name(),
 | 
			
		||||
		"graphdriver": d.GraphDriver().String(),
 | 
			
		||||
	}).Info("Docker daemon")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,12 +6,12 @@ import (
 | 
			
		|||
 | 
			
		||||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/docker/api/client"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/cli"
 | 
			
		||||
	flag "github.com/docker/docker/pkg/mflag"
 | 
			
		||||
	"github.com/docker/docker/pkg/reexec"
 | 
			
		||||
	"github.com/docker/docker/pkg/term"
 | 
			
		||||
	"github.com/docker/docker/utils"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
| 
						 | 
				
			
			@ -77,8 +77,8 @@ func main() {
 | 
			
		|||
 | 
			
		||||
func showVersion() {
 | 
			
		||||
	if utils.ExperimentalBuild() {
 | 
			
		||||
		fmt.Printf("Docker version %s, build %s, experimental\n", version.VERSION, version.GITCOMMIT)
 | 
			
		||||
		fmt.Printf("Docker version %s, build %s, experimental\n", dockerversion.VERSION, dockerversion.GITCOMMIT)
 | 
			
		||||
	} else {
 | 
			
		||||
		fmt.Printf("Docker version %s, build %s\n", version.VERSION, version.GITCOMMIT)
 | 
			
		||||
		fmt.Printf("Docker version %s, build %s\n", dockerversion.VERSION, dockerversion.GITCOMMIT)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,6 +17,7 @@ import (
 | 
			
		|||
 | 
			
		||||
	"github.com/Sirupsen/logrus"
 | 
			
		||||
	"github.com/docker/distribution/digest"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/daemon/graphdriver"
 | 
			
		||||
	"github.com/docker/docker/image"
 | 
			
		||||
	"github.com/docker/docker/pkg/archive"
 | 
			
		||||
| 
						 | 
				
			
			@ -26,7 +27,6 @@ import (
 | 
			
		|||
	"github.com/docker/docker/pkg/stringid"
 | 
			
		||||
	"github.com/docker/docker/pkg/truncindex"
 | 
			
		||||
	"github.com/docker/docker/runconfig"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
	"github.com/vbatts/tar-split/tar/asm"
 | 
			
		||||
	"github.com/vbatts/tar-split/tar/storage"
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			@ -247,7 +247,7 @@ func (graph *Graph) Create(layerData io.Reader, containerID, containerImage, com
 | 
			
		|||
		ID:            stringid.GenerateRandomID(),
 | 
			
		||||
		Comment:       comment,
 | 
			
		||||
		Created:       time.Now().UTC(),
 | 
			
		||||
		DockerVersion: version.VERSION,
 | 
			
		||||
		DockerVersion: dockerversion.VERSION,
 | 
			
		||||
		Author:        author,
 | 
			
		||||
		Config:        config,
 | 
			
		||||
		Architecture:  runtime.GOARCH,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,10 +9,10 @@ import (
 | 
			
		|||
	"testing"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/daemon/graphdriver"
 | 
			
		||||
	"github.com/docker/docker/image"
 | 
			
		||||
	"github.com/docker/docker/pkg/stringid"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func TestMount(t *testing.T) {
 | 
			
		||||
| 
						 | 
				
			
			@ -106,8 +106,8 @@ func TestGraphCreate(t *testing.T) {
 | 
			
		|||
	if img.Comment != "Testing" {
 | 
			
		||||
		t.Fatalf("Wrong comment: should be '%s', not '%s'", "Testing", img.Comment)
 | 
			
		||||
	}
 | 
			
		||||
	if img.DockerVersion != version.VERSION {
 | 
			
		||||
		t.Fatalf("Wrong docker_version: should be '%s', not '%s'", version.VERSION, img.DockerVersion)
 | 
			
		||||
	if img.DockerVersion != dockerversion.VERSION {
 | 
			
		||||
		t.Fatalf("Wrong docker_version: should be '%s', not '%s'", dockerversion.VERSION, img.DockerVersion)
 | 
			
		||||
	}
 | 
			
		||||
	images := graph.Map()
 | 
			
		||||
	if l := len(images); l != 1 {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -146,7 +146,7 @@ fi
 | 
			
		|||
EXTLDFLAGS_STATIC='-static'
 | 
			
		||||
# ORIG_BUILDFLAGS is necessary for the cross target which cannot always build
 | 
			
		||||
# with options like -race.
 | 
			
		||||
ORIG_BUILDFLAGS=( -a -tags "autogen netgo static_build sqlite_omit_load_extension $DOCKER_BUILDTAGS" -installsuffix netgo )
 | 
			
		||||
ORIG_BUILDFLAGS=( -a -tags "netgo static_build sqlite_omit_load_extension $DOCKER_BUILDTAGS" -installsuffix netgo )
 | 
			
		||||
# see https://github.com/golang/go/issues/9369#issuecomment-69864440 for why -installsuffix is necessary here
 | 
			
		||||
BUILDFLAGS=( $BUILDFLAGS "${ORIG_BUILDFLAGS[@]}" )
 | 
			
		||||
# Test timeout.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,14 +2,12 @@
 | 
			
		|||
 | 
			
		||||
rm -rf autogen
 | 
			
		||||
 | 
			
		||||
cat > version/version_autogen.go <<DVEOF
 | 
			
		||||
// +build autogen
 | 
			
		||||
// Package version is auto-generated at build-time
 | 
			
		||||
package version
 | 
			
		||||
mkdir -p autogen/dockerversion
 | 
			
		||||
cat > autogen/dockerversion/dockerversion.go <<DVEOF
 | 
			
		||||
// AUTOGENERATED FILE; see $BASH_SOURCE
 | 
			
		||||
package dockerversion
 | 
			
		||||
 | 
			
		||||
// Default build-time variable for library-import.
 | 
			
		||||
// This file is overridden on build with build-time informations.
 | 
			
		||||
const (
 | 
			
		||||
var (
 | 
			
		||||
	GITCOMMIT string = "$GITCOMMIT"
 | 
			
		||||
	VERSION   string = "$VERSION"
 | 
			
		||||
	BUILDTIME string = "$BUILDTIME"
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +16,6 @@ const (
 | 
			
		|||
	INITSHA1  string = "$DOCKER_INITSHA1"
 | 
			
		||||
	INITPATH  string = "$DOCKER_INITPATH"
 | 
			
		||||
)
 | 
			
		||||
// AUTOGENERATED FILE; see $BASH_SOURCE
 | 
			
		||||
DVEOF
 | 
			
		||||
 | 
			
		||||
# Compile the Windows resources into the sources
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,8 +5,8 @@ import (
 | 
			
		|||
	"net/http"
 | 
			
		||||
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/pkg/integration/checker"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
	"github.com/go-check/check"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -19,5 +19,5 @@ func (s *DockerSuite) TestGetVersion(c *check.C) {
 | 
			
		|||
 | 
			
		||||
	c.Assert(json.Unmarshal(body, &v), checker.IsNil)
 | 
			
		||||
 | 
			
		||||
	c.Assert(v.Version, checker.Equals, version.VERSION, check.Commentf("Version mismatch"))
 | 
			
		||||
	c.Assert(v.Version, checker.Equals, dockerversion.VERSION, check.Commentf("Version mismatch"))
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,9 +9,9 @@ import (
 | 
			
		|||
	"path/filepath"
 | 
			
		||||
	"runtime"
 | 
			
		||||
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/pkg/homedir"
 | 
			
		||||
	"github.com/docker/docker/pkg/integration/checker"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
	"github.com/go-check/check"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -54,7 +54,7 @@ func (s *DockerSuite) TestConfigHttpHeader(c *check.C) {
 | 
			
		|||
 | 
			
		||||
	c.Assert(headers["User-Agent"], checker.NotNil, check.Commentf("Missing User-Agent"))
 | 
			
		||||
 | 
			
		||||
	c.Assert(headers["User-Agent"][0], checker.Equals, "Docker-Client/"+version.VERSION+" ("+runtime.GOOS+")", check.Commentf("Badly formatted User-Agent,out:%v", out))
 | 
			
		||||
	c.Assert(headers["User-Agent"][0], checker.Equals, "Docker-Client/"+dockerversion.VERSION+" ("+runtime.GOOS+")", check.Commentf("Badly formatted User-Agent,out:%v", out))
 | 
			
		||||
 | 
			
		||||
	c.Assert(headers["Myheader"], checker.NotNil)
 | 
			
		||||
	c.Assert(headers["Myheader"][0], checker.Equals, "MyValue", check.Commentf("Missing/bad header,out:%v", out))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,10 +20,10 @@ import (
 | 
			
		|||
	"github.com/docker/distribution/registry/api/v2"
 | 
			
		||||
	"github.com/docker/distribution/registry/client"
 | 
			
		||||
	"github.com/docker/distribution/registry/client/transport"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/pkg/parsers/kernel"
 | 
			
		||||
	"github.com/docker/docker/pkg/tlsconfig"
 | 
			
		||||
	"github.com/docker/docker/pkg/useragent"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
| 
						 | 
				
			
			@ -39,9 +39,9 @@ var dockerUserAgent string
 | 
			
		|||
 | 
			
		||||
func init() {
 | 
			
		||||
	httpVersion := make([]useragent.VersionInfo, 0, 6)
 | 
			
		||||
	httpVersion = append(httpVersion, useragent.VersionInfo{"docker", version.VERSION})
 | 
			
		||||
	httpVersion = append(httpVersion, useragent.VersionInfo{"docker", dockerversion.VERSION})
 | 
			
		||||
	httpVersion = append(httpVersion, useragent.VersionInfo{"go", runtime.Version()})
 | 
			
		||||
	httpVersion = append(httpVersion, useragent.VersionInfo{"git-commit", version.GITCOMMIT})
 | 
			
		||||
	httpVersion = append(httpVersion, useragent.VersionInfo{"git-commit", dockerversion.GITCOMMIT})
 | 
			
		||||
	if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
 | 
			
		||||
		httpVersion = append(httpVersion, useragent.VersionInfo{"kernel", kernelVersion.String()})
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,10 +14,10 @@ import (
 | 
			
		|||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/docker/distribution/registry/api/errcode"
 | 
			
		||||
	"github.com/docker/docker/autogen/dockerversion"
 | 
			
		||||
	"github.com/docker/docker/pkg/archive"
 | 
			
		||||
	"github.com/docker/docker/pkg/fileutils"
 | 
			
		||||
	"github.com/docker/docker/pkg/stringid"
 | 
			
		||||
	"github.com/docker/docker/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// SelfPath figures out the absolute path of our own binary (if it's still around).
 | 
			
		||||
| 
						 | 
				
			
			@ -60,7 +60,7 @@ func isValidDockerInitPath(target string, selfPath string) bool { // target and
 | 
			
		|||
	if target == "" {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
	if version.IAMSTATIC == "true" {
 | 
			
		||||
	if dockerversion.IAMSTATIC == "true" {
 | 
			
		||||
		if selfPath == "" {
 | 
			
		||||
			return false
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -77,7 +77,7 @@ func isValidDockerInitPath(target string, selfPath string) bool { // target and
 | 
			
		|||
		}
 | 
			
		||||
		return os.SameFile(targetFileInfo, selfPathFileInfo)
 | 
			
		||||
	}
 | 
			
		||||
	return version.INITSHA1 != "" && dockerInitSha1(target) == version.INITSHA1
 | 
			
		||||
	return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DockerInitPath figures out the path of our dockerinit (which may be SelfPath())
 | 
			
		||||
| 
						 | 
				
			
			@ -89,7 +89,7 @@ func DockerInitPath(localCopy string) string {
 | 
			
		|||
	}
 | 
			
		||||
	var possibleInits = []string{
 | 
			
		||||
		localCopy,
 | 
			
		||||
		version.INITPATH,
 | 
			
		||||
		dockerversion.INITPATH,
 | 
			
		||||
		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."
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,16 +0,0 @@
 | 
			
		|||
// +build !autogen
 | 
			
		||||
 | 
			
		||||
// Package version is auto-generated at build-time
 | 
			
		||||
package version
 | 
			
		||||
 | 
			
		||||
// Default build-time variable for library-import.
 | 
			
		||||
// This file is overridden on build with build-time informations.
 | 
			
		||||
const (
 | 
			
		||||
	GITCOMMIT string = "library-import"
 | 
			
		||||
	VERSION   string = "library-import"
 | 
			
		||||
	BUILDTIME string = "library-import"
 | 
			
		||||
 | 
			
		||||
	IAMSTATIC string = "library-import"
 | 
			
		||||
	INITSHA1  string = "library-import"
 | 
			
		||||
	INITPATH  string = "library-import"
 | 
			
		||||
)
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue