mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #34554 from dnephin/use-release-version-of-docker-cli
Pin docker-cli version to the 17.06-ce release version
This commit is contained in:
commit
e23965d620
6 changed files with 49 additions and 41 deletions
2
Makefile
2
Makefile
|
@ -110,7 +110,7 @@ dynbinary: build ## build the linux dynbinaries
|
||||||
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary
|
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary
|
||||||
|
|
||||||
build: bundles init-go-pkg-cache
|
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)" .
|
docker build ${BUILD_APT_MIRROR} ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" -f "$(DOCKERFILE)" .
|
||||||
|
|
||||||
bundles:
|
bundles:
|
||||||
|
|
|
@ -9,9 +9,5 @@ TINI_COMMIT=949e6facb77383876aeff8a6944dde66b3089574
|
||||||
LIBNETWORK_COMMIT=7b2b1feb1de4817d522cc372af149ff48d25028e
|
LIBNETWORK_COMMIT=7b2b1feb1de4817d522cc372af149ff48d25028e
|
||||||
VNDR_COMMIT=9909bb2b8a0b7ea464527b376dc50389c90df587
|
VNDR_COMMIT=9909bb2b8a0b7ea464527b376dc50389c90df587
|
||||||
|
|
||||||
# CLI
|
|
||||||
DOCKERCLI_REPO=https://github.com/docker/cli
|
|
||||||
DOCKERCLI_COMMIT=3dfb8343b139d6342acfd9975d7f1068b5b1c3d3
|
|
||||||
|
|
||||||
# Linting
|
# Linting
|
||||||
GOMETALINTER_COMMIT=f7b6e55301c9c67035003b7ba7f8a1cde532d338
|
GOMETALINTER_COMMIT=f7b6e55301c9c67035003b7ba7f8a1cde532d338
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
@ -47,10 +47,31 @@ install_proxy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_dockercli() {
|
install_dockercli() {
|
||||||
echo "Install docker/cli version $DOCKERCLI_COMMIT"
|
DOCKERCLI_CHANNEL=${DOCKERCLI_CHANNEL:-edge}
|
||||||
git clone "$DOCKERCLI_REPO" "$GOPATH/src/github.com/docker/cli"
|
DOCKERCLI_VERSION=${DOCKERCLI_VERSION:-17.06.0-ce}
|
||||||
cd "$GOPATH/src/github.com/docker/cli"
|
echo "Install docker/cli version $DOCKERCLI_VERSION from $DOCKERCLI_CHANNEL"
|
||||||
git checkout -q "$DOCKERCLI_COMMIT"
|
|
||||||
|
arch=$(uname -m)
|
||||||
|
# No official release of these platforms
|
||||||
|
if [[ "$arch" != "x86_64" ]] && [[ "$arch" != "s390x" ]]; then
|
||||||
|
build_dockercli
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
build_dockercli() {
|
||||||
|
DOCKERCLI_VERSION=${DOCKERCLI_VERSION:-17.06.0-ce}
|
||||||
|
git clone https://github.com/docker/docker-ce "$GOPATH/tmp/docker-ce"
|
||||||
|
cd "$GOPATH/tmp/docker-ce"
|
||||||
|
git checkout -q "v$DOCKERCLI_VERSION"
|
||||||
|
mkdir -p "$GOPATH/src/github.com/docker"
|
||||||
|
mv components/cli "$GOPATH/src/github.com/docker/cli"
|
||||||
go build -o /usr/local/bin/docker github.com/docker/cli/cmd/docker
|
go build -o /usr/local/bin/docker github.com/docker/cli/cmd/docker
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,7 @@ param(
|
||||||
)
|
)
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
$ProgressPreference = "SilentlyContinue"
|
||||||
$pushed=$False # To restore the directory if we have temporarily pushed to one.
|
$pushed=$False # To restore the directory if we have temporarily pushed to one.
|
||||||
|
|
||||||
# Utility function to get the commit ID of the repository
|
# Utility function to get the commit ID of the repository
|
||||||
|
@ -398,39 +399,29 @@ Try {
|
||||||
# Perform the actual build
|
# Perform the actual build
|
||||||
if ($Daemon) { Execute-Build "daemon" "daemon" "dockerd" }
|
if ($Daemon) { Execute-Build "daemon" "daemon" "dockerd" }
|
||||||
if ($Client) {
|
if ($Client) {
|
||||||
# Get the repo and commit of the client to build.
|
# Get the Docker channel and version from the environment, or use the defaults.
|
||||||
"hack\dockerfile\binaries-commits" | ForEach-Object {
|
if (-not ($channel = $env:DOCKERCLI_CHANNEL)) { $channel = "edge" }
|
||||||
$dockerCliRepo = ((Get-Content $_ | Select-String "DOCKERCLI_REPO") -split "=")[1]
|
if (-not ($version = $env:DOCKERCLI_VERSION)) { $version = "17.06.0-ce" }
|
||||||
$dockerCliCommit = ((Get-Content $_ | Select-String "DOCKERCLI_COMMIT") -split "=")[1]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Build from a temporary directory.
|
# Download the zip file and extract the client executable.
|
||||||
$tempLocation = "$env:TEMP\$(New-Guid)"
|
Write-Host "INFO: Downloading docker/cli version $version from $channel..."
|
||||||
New-Item -ItemType Directory $tempLocation | Out-Null
|
$url = "https://download.docker.com/win/static/$channel/x86_64/docker-$version.zip"
|
||||||
|
Invoke-WebRequest $url -OutFile "docker.zip"
|
||||||
# Temporarily override GOPATH, then clone, checkout, and build.
|
|
||||||
$saveGOPATH = $env:GOPATH
|
|
||||||
Try {
|
Try {
|
||||||
$env:GOPATH = $tempLocation
|
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||||
$dockerCliRoot = "$env:GOPATH\src\github.com\docker\cli"
|
$zip = [System.IO.Compression.ZipFile]::OpenRead("$PWD\docker.zip")
|
||||||
Write-Host "INFO: Cloning client repository..."
|
Try {
|
||||||
Invoke-Expression "git clone -q $dockerCliRepo $dockerCliRoot"
|
if (-not ($entry = $zip.Entries | Where-Object { $_.Name -eq "docker.exe" })) {
|
||||||
if ($LASTEXITCODE -ne 0) { Throw "Failed to clone client repository $dockerCliRepo" }
|
Throw "Cannot find docker.exe in $url"
|
||||||
Invoke-Expression "git -C $dockerCliRoot checkout -q $dockerCliCommit"
|
}
|
||||||
if ($LASTEXITCODE -ne 0) { Throw "Failed to checkout client commit $dockerCliCommit" }
|
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, "$PWD\bundles\docker.exe", $true)
|
||||||
Write-Host "INFO: Building client..."
|
}
|
||||||
Push-Location "$dockerCliRoot\cmd\docker"; $global:pushed=$True
|
Finally {
|
||||||
Invoke-Expression "go build -o $root\bundles\docker.exe"
|
$zip.Dispose()
|
||||||
if ($LASTEXITCODE -ne 0) { Throw "Failed to compile client" }
|
}
|
||||||
Pop-Location; $global:pushed=$False
|
|
||||||
}
|
|
||||||
Catch [Exception] {
|
|
||||||
Throw $_
|
|
||||||
}
|
}
|
||||||
Finally {
|
Finally {
|
||||||
# Always restore GOPATH and remove the temporary directory.
|
Remove-Item -Force "docker.zip"
|
||||||
$env:GOPATH = $saveGOPATH
|
|
||||||
Remove-Item -Force -Recurse $tempLocation
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ func (s *DockerSwarmSuite) TestServiceLogs(c *check.C) {
|
||||||
// make sure task has been deployed.
|
// make sure task has been deployed.
|
||||||
waitAndAssert(c, defaultReconciliationTimeout,
|
waitAndAssert(c, defaultReconciliationTimeout,
|
||||||
d.CheckRunningTaskImages, checker.DeepEquals,
|
d.CheckRunningTaskImages, checker.DeepEquals,
|
||||||
map[string]int{"busybox": len(services)})
|
map[string]int{"busybox:latest": len(services)})
|
||||||
|
|
||||||
for name, message := range services {
|
for name, message := range services {
|
||||||
out, err := d.Cmd("service", "logs", name)
|
out, err := d.Cmd("service", "logs", name)
|
||||||
|
|
|
@ -94,7 +94,7 @@ func (s *DockerSwarmSuite) TestSwarmNetworkPluginV2(c *check.C) {
|
||||||
|
|
||||||
time.Sleep(20 * time.Second)
|
time.Sleep(20 * time.Second)
|
||||||
|
|
||||||
image := "busybox"
|
image := "busybox:latest"
|
||||||
// create a new global service again.
|
// create a new global service again.
|
||||||
_, err = d1.Cmd("service", "create", "--no-resolve-image", "--name", serviceName, "--mode=global", "--network", networkName, image, "top")
|
_, err = d1.Cmd("service", "create", "--no-resolve-image", "--name", serviceName, "--mode=global", "--network", networkName, image, "top")
|
||||||
c.Assert(err, checker.IsNil)
|
c.Assert(err, checker.IsNil)
|
||||||
|
|
Loading…
Reference in a new issue