Pin docker-cli version to the 17.06-ce release version

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2017-08-17 17:27:41 -04:00
parent bbcdc7df34
commit cef786f787
6 changed files with 34 additions and 41 deletions

View file

@ -110,7 +110,7 @@ dynbinary: build ## build the linux dynbinaries
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary
build: bundles init-go-pkg-cache
$(warning The docker client CLI has moved to github.com/docker/cli. By default, it is built from the git sha specified in hack/dockerfile/binaries-commits. For a dev-test cycle involving the CLI, run:${\n} DOCKER_CLI_PATH=/host/path/to/cli/binary make shell ${\n} then change the cli and compile into a binary at the same location.${\n})
$(warning The docker client CLI has moved to github.com/docker/cli. For a dev-test cycle involving the CLI, run:${\n} DOCKER_CLI_PATH=/host/path/to/cli/binary make shell ${\n} then change the cli and compile into a binary at the same location.${\n})
docker build ${BUILD_APT_MIRROR} ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" -f "$(DOCKERFILE)" .
bundles:

View file

@ -9,9 +9,5 @@ TINI_COMMIT=949e6facb77383876aeff8a6944dde66b3089574
LIBNETWORK_COMMIT=7b2b1feb1de4817d522cc372af149ff48d25028e
VNDR_COMMIT=9909bb2b8a0b7ea464527b376dc50389c90df587
# CLI
DOCKERCLI_REPO=https://github.com/docker/cli
DOCKERCLI_COMMIT=3dfb8343b139d6342acfd9975d7f1068b5b1c3d3
# Linting
GOMETALINTER_COMMIT=f7b6e55301c9c67035003b7ba7f8a1cde532d338

View file

@ -47,11 +47,17 @@ install_proxy() {
}
install_dockercli() {
echo "Install docker/cli version $DOCKERCLI_COMMIT"
git clone "$DOCKERCLI_REPO" "$GOPATH/src/github.com/docker/cli"
cd "$GOPATH/src/github.com/docker/cli"
git checkout -q "$DOCKERCLI_COMMIT"
go build -o /usr/local/bin/docker github.com/docker/cli/cmd/docker
DOCKERCLI_CHANNEL=${DOCKERCLI_CHANNEL:-edge}
DOCKERCLI_VERSION=${DOCKERCLI_VERSION:-17.06.0-ce}
echo "Install docker/cli version $DOCKERCLI_VERSION from $DOCKERCLI_CHANNEL"
arch=$(uname -m)
echo "Docker CLI ARCH $arch"
url=https://download.docker.com/linux/static
curl -Ls $url/$DOCKERCLI_CHANNEL/$arch/docker-$DOCKERCLI_VERSION.tgz | \
tar -xz docker/docker
mv docker/docker /usr/local/bin/
rmdir docker
}
install_gometalinter() {

View file

@ -88,6 +88,7 @@ param(
)
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
$pushed=$False # To restore the directory if we have temporarily pushed to one.
# Utility function to get the commit ID of the repository
@ -398,39 +399,29 @@ Try {
# Perform the actual build
if ($Daemon) { Execute-Build "daemon" "daemon" "dockerd" }
if ($Client) {
# Get the repo and commit of the client to build.
"hack\dockerfile\binaries-commits" | ForEach-Object {
$dockerCliRepo = ((Get-Content $_ | Select-String "DOCKERCLI_REPO") -split "=")[1]
$dockerCliCommit = ((Get-Content $_ | Select-String "DOCKERCLI_COMMIT") -split "=")[1]
}
# Get the Docker channel and version from the environment, or use the defaults.
if (-not ($channel = $env:DOCKERCLI_CHANNEL)) { $channel = "edge" }
if (-not ($version = $env:DOCKERCLI_VERSION)) { $version = "17.06.0-ce" }
# Build from a temporary directory.
$tempLocation = "$env:TEMP\$(New-Guid)"
New-Item -ItemType Directory $tempLocation | Out-Null
# Temporarily override GOPATH, then clone, checkout, and build.
$saveGOPATH = $env:GOPATH
# Download the zip file and extract the client executable.
Write-Host "INFO: Downloading docker/cli version $version from $channel..."
$url = "https://download.docker.com/win/static/$channel/x86_64/docker-$version.zip"
Invoke-WebRequest $url -OutFile "docker.zip"
Try {
$env:GOPATH = $tempLocation
$dockerCliRoot = "$env:GOPATH\src\github.com\docker\cli"
Write-Host "INFO: Cloning client repository..."
Invoke-Expression "git clone -q $dockerCliRepo $dockerCliRoot"
if ($LASTEXITCODE -ne 0) { Throw "Failed to clone client repository $dockerCliRepo" }
Invoke-Expression "git -C $dockerCliRoot checkout -q $dockerCliCommit"
if ($LASTEXITCODE -ne 0) { Throw "Failed to checkout client commit $dockerCliCommit" }
Write-Host "INFO: Building client..."
Push-Location "$dockerCliRoot\cmd\docker"; $global:pushed=$True
Invoke-Expression "go build -o $root\bundles\docker.exe"
if ($LASTEXITCODE -ne 0) { Throw "Failed to compile client" }
Pop-Location; $global:pushed=$False
}
Catch [Exception] {
Throw $_
Add-Type -AssemblyName System.IO.Compression.FileSystem
$zip = [System.IO.Compression.ZipFile]::OpenRead("$PWD\docker.zip")
Try {
if (-not ($entry = $zip.Entries | Where-Object { $_.Name -eq "docker.exe" })) {
Throw "Cannot find docker.exe in $url"
}
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, "$PWD\bundles\docker.exe", $true)
}
Finally {
$zip.Dispose()
}
}
Finally {
# Always restore GOPATH and remove the temporary directory.
$env:GOPATH = $saveGOPATH
Remove-Item -Force -Recurse $tempLocation
Remove-Item -Force "docker.zip"
}
}
}

View file

@ -40,7 +40,7 @@ func (s *DockerSwarmSuite) TestServiceLogs(c *check.C) {
// make sure task has been deployed.
waitAndAssert(c, defaultReconciliationTimeout,
d.CheckRunningTaskImages, checker.DeepEquals,
map[string]int{"busybox": len(services)})
map[string]int{"busybox:latest": len(services)})
for name, message := range services {
out, err := d.Cmd("service", "logs", name)

View file

@ -94,7 +94,7 @@ func (s *DockerSwarmSuite) TestSwarmNetworkPluginV2(c *check.C) {
time.Sleep(20 * time.Second)
image := "busybox"
image := "busybox:latest"
// create a new global service again.
_, err = d1.Cmd("service", "create", "--no-resolve-image", "--name", serviceName, "--mode=global", "--network", networkName, image, "top")
c.Assert(err, checker.IsNil)