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
|
||||
|
||||
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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
|
@ -47,10 +47,31 @@ 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"
|
||||
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)
|
||||
# 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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
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"
|
||||
}
|
||||
Catch [Exception] {
|
||||
Throw $_
|
||||
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, "$PWD\bundles\docker.exe", $true)
|
||||
}
|
||||
Finally {
|
||||
# Always restore GOPATH and remove the temporary directory.
|
||||
$env:GOPATH = $saveGOPATH
|
||||
Remove-Item -Force -Recurse $tempLocation
|
||||
$zip.Dispose()
|
||||
}
|
||||
}
|
||||
Finally {
|
||||
Remove-Item -Force "docker.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue