2016-10-21 00:02:26 +00:00
|
|
|
# escape=`
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------------------
|
|
|
|
# This file describes the standard way to build Docker in a container on Windows
|
2016-11-17 21:54:56 +00:00
|
|
|
# Server 2016 or Windows 10.
|
2016-10-21 00:02:26 +00:00
|
|
|
#
|
|
|
|
# Maintainer: @jhowardmsft
|
|
|
|
# -----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
# Prerequisites:
|
|
|
|
# --------------
|
|
|
|
#
|
2016-11-17 21:54:56 +00:00
|
|
|
# 1. Windows Server 2016 or Windows 10 with all Windows updates applied. The major
|
|
|
|
# build number must be at least 14393. This can be confirmed, for example, by
|
|
|
|
# running the following from an elevated PowerShell prompt - this sample output
|
|
|
|
# is from a fully up to date machine as at mid-November 2016:
|
2015-12-01 08:47:19 +00:00
|
|
|
#
|
2016-10-21 00:02:26 +00:00
|
|
|
# >> PS C:\> $(gin).WindowsBuildLabEx
|
2016-11-17 21:54:56 +00:00
|
|
|
# >> 14393.447.amd64fre.rs1_release_inmarket.161102-0100
|
2016-10-21 00:02:26 +00:00
|
|
|
#
|
|
|
|
# 2. Git for Windows (or another git client) must be installed. https://git-scm.com/download/win.
|
|
|
|
#
|
|
|
|
# 3. The machine must be configured to run containers. For example, by following
|
|
|
|
# the quick start guidance at https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start or
|
|
|
|
# https://github.com/docker/labs/blob/master/windows/windows-containers/Setup.md
|
2016-11-17 21:54:56 +00:00
|
|
|
#
|
|
|
|
# 4. If building in a Hyper-V VM: For Windows Server 2016 using Windows Server
|
|
|
|
# containers as the default option, it is recommended you have at least 1GB
|
|
|
|
# of memory assigned; For Windows 10 where Hyper-V Containers are employed, you
|
|
|
|
# should have at least 4GB of memory assigned. Note also, to run Hyper-V
|
|
|
|
# containers in a VM, it is necessary to configure the VM for nested virtualization.
|
2016-10-21 00:02:26 +00:00
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2015-12-01 08:47:19 +00:00
|
|
|
# Usage:
|
2016-10-21 00:02:26 +00:00
|
|
|
# -----
|
|
|
|
#
|
|
|
|
# The following steps should be run from an (elevated*) Windows PowerShell prompt.
|
|
|
|
#
|
|
|
|
# (*In a default installation of containers on Windows following the quick-start guidance at
|
|
|
|
# https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start,
|
|
|
|
# the docker.exe client must run elevated to be able to connect to the daemon).
|
|
|
|
#
|
|
|
|
# 1. Clone the sources from github.com:
|
|
|
|
#
|
2019-09-09 23:19:03 +00:00
|
|
|
# >> git clone https://github.com/docker/docker.git C:\gopath\src\github.com\docker\docker
|
|
|
|
# >> Cloning into 'C:\gopath\src\github.com\docker\docker'...
|
2016-10-21 00:02:26 +00:00
|
|
|
# >> remote: Counting objects: 186216, done.
|
|
|
|
# >> remote: Compressing objects: 100% (21/21), done.
|
|
|
|
# >> remote: Total 186216 (delta 5), reused 0 (delta 0), pack-reused 186195
|
|
|
|
# >> Receiving objects: 100% (186216/186216), 104.32 MiB | 8.18 MiB/s, done.
|
|
|
|
# >> Resolving deltas: 100% (123139/123139), done.
|
|
|
|
# >> Checking connectivity... done.
|
|
|
|
# >> Checking out files: 100% (3912/3912), done.
|
|
|
|
# >> PS C:\>
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# 2. Change directory to the cloned docker sources:
|
2015-12-01 08:47:19 +00:00
|
|
|
#
|
2019-09-09 23:19:03 +00:00
|
|
|
# >> cd C:\gopath\src\github.com\docker\docker
|
2016-01-21 02:51:34 +00:00
|
|
|
#
|
2015-12-01 08:47:19 +00:00
|
|
|
#
|
2016-12-05 22:01:17 +00:00
|
|
|
# 3. Build a docker image with the components required to build the docker binaries from source
|
|
|
|
# by running one of the following:
|
2015-12-01 08:47:19 +00:00
|
|
|
#
|
2016-12-05 22:01:17 +00:00
|
|
|
# >> docker build -t nativebuildimage -f Dockerfile.windows .
|
|
|
|
# >> docker build -t nativebuildimage -f Dockerfile.windows -m 2GB . (if using Hyper-V containers)
|
2016-01-21 02:51:34 +00:00
|
|
|
#
|
|
|
|
#
|
2016-12-05 22:01:17 +00:00
|
|
|
# 4. Build the docker executable binaries by running one of the following:
|
2016-10-21 00:02:26 +00:00
|
|
|
#
|
2017-01-20 23:09:28 +00:00
|
|
|
# >> $DOCKER_GITCOMMIT=(git rev-parse --short HEAD)
|
|
|
|
# >> docker run --name binaries -e DOCKER_GITCOMMIT=$DOCKER_GITCOMMIT nativebuildimage hack\make.ps1 -Binary
|
|
|
|
# >> docker run --name binaries -e DOCKER_GITCOMMIT=$DOCKER_GITCOMMIT -m 2GB nativebuildimage hack\make.ps1 -Binary (if using Hyper-V containers)
|
2016-10-21 00:02:26 +00:00
|
|
|
#
|
|
|
|
#
|
2016-11-17 21:54:56 +00:00
|
|
|
# 5. Copy the binaries out of the container, replacing HostPath with an appropriate destination
|
2016-10-21 00:02:26 +00:00
|
|
|
# folder on the host system where you want the binaries to be located.
|
|
|
|
#
|
2019-09-09 23:19:03 +00:00
|
|
|
# >> docker cp binaries:C:\gopath\src\github.com\docker\docker\bundles\docker.exe C:\HostPath\docker.exe
|
|
|
|
# >> docker cp binaries:C:\gopath\src\github.com\docker\docker\bundles\dockerd.exe C:\HostPath\dockerd.exe
|
2016-10-21 00:02:26 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# 6. (Optional) Remove the interim container holding the built executable binaries:
|
|
|
|
#
|
|
|
|
# >> docker rm binaries
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# 7. (Optional) Remove the image used for the container in which the executable
|
|
|
|
# binaries are build. Tip - it may be useful to keep this image around if you need to
|
|
|
|
# build multiple times. Then you can take advantage of the builder cache to have an
|
|
|
|
# image which has all the components required to build the binaries already installed.
|
|
|
|
#
|
|
|
|
# >> docker rmi nativebuildimage
|
2016-11-17 21:54:56 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2017-01-20 23:09:28 +00:00
|
|
|
# The validation tests can only run directly on the host. This is because they calculate
|
|
|
|
# information from the git repo, but the .git directory is not passed into the image as
|
|
|
|
# it is excluded via .dockerignore. Run the following from a Windows PowerShell prompt
|
|
|
|
# (elevation is not required): (Note Go must be installed to run these tests)
|
2016-11-17 21:54:56 +00:00
|
|
|
#
|
|
|
|
# >> hack\make.ps1 -DCO -PkgImports -GoFormat
|
|
|
|
|
2017-01-20 23:09:28 +00:00
|
|
|
|
2016-11-17 21:54:56 +00:00
|
|
|
# -----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2016-12-05 22:01:17 +00:00
|
|
|
# To run unit tests, ensure you have created the nativebuildimage above. Then run one of
|
|
|
|
# the following from an (elevated) Windows PowerShell prompt:
|
2016-11-17 21:54:56 +00:00
|
|
|
#
|
|
|
|
# >> docker run --rm nativebuildimage hack\make.ps1 -TestUnit
|
2016-12-05 22:01:17 +00:00
|
|
|
# >> docker run --rm -m 2GB nativebuildimage hack\make.ps1 -TestUnit (if using Hyper-V containers)
|
2016-11-17 21:54:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2017-01-20 23:09:28 +00:00
|
|
|
# To run unit tests and binary build, ensure you have created the nativebuildimage above. Then
|
2016-12-05 22:01:17 +00:00
|
|
|
# run one of the following from an (elevated) Windows PowerShell prompt:
|
2016-11-17 21:54:56 +00:00
|
|
|
#
|
|
|
|
# >> docker run nativebuildimage hack\make.ps1 -All
|
2016-12-05 22:01:17 +00:00
|
|
|
# >> docker run -m 2GB nativebuildimage hack\make.ps1 -All (if using Hyper-V containers)
|
2016-10-21 00:02:26 +00:00
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2016-01-21 02:51:34 +00:00
|
|
|
# Important notes:
|
|
|
|
# ---------------
|
|
|
|
#
|
2017-08-19 14:23:38 +00:00
|
|
|
# Don't attempt to use a bind mount to pass a local directory as the bundles target
|
|
|
|
# directory. It does not work (golang attempts for follow a mapped folder incorrectly).
|
2016-11-17 21:54:56 +00:00
|
|
|
# Instead, use docker cp as per the example.
|
2016-01-21 02:51:34 +00:00
|
|
|
#
|
2016-11-17 21:54:56 +00:00
|
|
|
# go.zip is not removed from the image as it is used by the Windows CI servers
|
|
|
|
# to ensure the host and image are running consistent versions of go.
|
2016-01-31 04:50:11 +00:00
|
|
|
#
|
2016-11-17 21:54:56 +00:00
|
|
|
# Nanoserver support is a work in progress. Although the image will build if the
|
|
|
|
# FROM statement is updated, it will not work when running autogen through hack\make.ps1.
|
|
|
|
# It is suspected that the required GCC utilities (eg gcc, windres, windmc) silently
|
|
|
|
# quit due to the use of console hooks which are not available.
|
2016-10-21 00:02:26 +00:00
|
|
|
#
|
2016-11-17 21:54:56 +00:00
|
|
|
# The docker integration tests do not currently run in a container on Windows, predominantly
|
|
|
|
# due to Windows not supporting privileged mode, so anything using a volume would fail.
|
|
|
|
# They (along with the rest of the docker CI suite) can be run using
|
2019-09-26 09:59:51 +00:00
|
|
|
# https://github.com/kevpar/docker-w2wCIScripts/blob/master/runCI/Invoke-DockerCI.ps1.
|
2016-11-10 20:45:56 +00:00
|
|
|
#
|
2016-10-21 00:02:26 +00:00
|
|
|
# -----------------------------------------------------------------------------------------
|
2015-12-01 08:47:19 +00:00
|
|
|
|
2016-11-17 21:54:56 +00:00
|
|
|
|
2016-10-21 00:02:26 +00:00
|
|
|
# The number of build steps below are explicitly minimised to improve performance.
|
2019-01-04 19:58:11 +00:00
|
|
|
|
|
|
|
# Extremely important - do not change the following line to reference a "specific" image,
|
2022-08-26 02:09:48 +00:00
|
|
|
# such as `mcr.microsoft.com/windows/servercore:ltsc2022`. If using this Dockerfile in process
|
2019-01-04 19:58:11 +00:00
|
|
|
# isolated containers, the kernel of the host must match the container image, and hence
|
|
|
|
# would fail between Windows Server 2016 (aka RS1) and Windows Server 2019 (aka RS5).
|
|
|
|
# It is expected that the image `microsoft/windowsservercore:latest` is present, and matches
|
|
|
|
# the hosts kernel version before doing a build.
|
2016-10-21 00:02:26 +00:00
|
|
|
FROM microsoft/windowsservercore
|
2015-12-01 08:47:19 +00:00
|
|
|
|
2016-10-30 20:57:40 +00:00
|
|
|
# Use PowerShell as the default shell
|
2017-02-05 07:28:34 +00:00
|
|
|
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
2016-10-30 20:57:40 +00:00
|
|
|
|
update to go1.19.4
Includes security fixes for net/http (CVE-2022-41717, CVE-2022-41720),
and os (CVE-2022-41720).
These minor releases include 2 security fixes following the security policy:
- os, net/http: avoid escapes from os.DirFS and http.Dir on Windows
The os.DirFS function and http.Dir type provide access to a tree of files
rooted at a given directory. These functions permitted access to Windows
device files under that root. For example, os.DirFS("C:/tmp").Open("COM1")
would open the COM1 device.
Both os.DirFS and http.Dir only provide read-only filesystem access.
In addition, on Windows, an os.DirFS for the directory \(the root of the
current drive) can permit a maliciously crafted path to escape from the
drive and access any path on the system.
The behavior of os.DirFS("") has changed. Previously, an empty root was
treated equivalently to "/", so os.DirFS("").Open("tmp") would open the
path "/tmp". This now returns an error.
This is CVE-2022-41720 and Go issue https://go.dev/issue/56694.
- net/http: limit canonical header cache by bytes, not entries
An attacker can cause excessive memory growth in a Go server accepting
HTTP/2 requests.
HTTP/2 server connections contain a cache of HTTP header keys sent by
the client. While the total number of entries in this cache is capped,
an attacker sending very large keys can cause the server to allocate
approximately 64 MiB per open connection.
This issue is also fixed in golang.org/x/net/http2 vX.Y.Z, for users
manually configuring HTTP/2.
Thanks to Josselin Costanzi for reporting this issue.
This is CVE-2022-41717 and Go issue https://go.dev/issue/56350.
View the release notes for more information:
https://go.dev/doc/devel/release#go1.19.4
And the milestone on the issue tracker:
https://github.com/golang/go/issues?q=milestone%3AGo1.19.4+label%3ACherryPickApproved
Full diff: https://github.com/golang/go/compare/go1.19.3...go1.19.4
The golang.org/x/net fix is in https://github.com/golang/net/commit/1e63c2f08a10a150fa02c50ece89b340ae64efe4
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 52bc1ad744345b5dd9ec4d3af24ff66cdb23865f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-06 21:57:25 +00:00
|
|
|
ARG GO_VERSION=1.19.4
|
2022-11-17 16:05:20 +00:00
|
|
|
ARG GOTESTSUM_VERSION=v1.8.2
|
2022-11-17 16:32:06 +00:00
|
|
|
ARG GOWINRES_VERSION=v0.3.0
|
2022-12-19 17:38:04 +00:00
|
|
|
ARG CONTAINERD_VERSION=v1.6.14
|
2019-07-17 11:59:16 +00:00
|
|
|
|
2016-01-21 02:51:34 +00:00
|
|
|
# Environment variable notes:
|
2016-10-30 20:57:40 +00:00
|
|
|
# - GO_VERSION must be consistent with 'Dockerfile' used by Linux.
|
2020-09-21 19:21:22 +00:00
|
|
|
# - CONTAINERD_VERSION must be consistent with 'hack/dockerfile/install/containerd.installer' used by Linux.
|
2016-01-21 02:51:34 +00:00
|
|
|
# - FROM_DOCKERFILE is used for detection of building within a container.
|
2019-07-17 11:59:16 +00:00
|
|
|
ENV GO_VERSION=${GO_VERSION} `
|
2020-09-21 19:21:22 +00:00
|
|
|
CONTAINERD_VERSION=${CONTAINERD_VERSION} `
|
2017-02-05 07:28:34 +00:00
|
|
|
GIT_VERSION=2.11.1 `
|
2019-09-09 23:19:03 +00:00
|
|
|
GOPATH=C:\gopath `
|
2019-09-11 07:36:53 +00:00
|
|
|
GO111MODULE=off `
|
2019-10-08 01:14:51 +00:00
|
|
|
FROM_DOCKERFILE=1 `
|
2022-04-12 11:15:54 +00:00
|
|
|
GOTESTSUM_VERSION=${GOTESTSUM_VERSION} `
|
|
|
|
GOWINRES_VERSION=${GOWINRES_VERSION}
|
2015-12-01 08:47:19 +00:00
|
|
|
|
2016-10-21 00:02:26 +00:00
|
|
|
RUN `
|
2016-11-17 21:54:56 +00:00
|
|
|
Function Test-Nano() { `
|
|
|
|
$EditionId = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'EditionID').EditionId; `
|
|
|
|
return (($EditionId -eq 'ServerStandardNano') -or ($EditionId -eq 'ServerDataCenterNano') -or ($EditionId -eq 'NanoServer')); `
|
|
|
|
}`
|
|
|
|
`
|
2016-10-21 00:02:26 +00:00
|
|
|
Function Download-File([string] $source, [string] $target) { `
|
2016-11-17 21:54:56 +00:00
|
|
|
if (Test-Nano) { `
|
|
|
|
$handler = New-Object System.Net.Http.HttpClientHandler; `
|
|
|
|
$client = New-Object System.Net.Http.HttpClient($handler); `
|
|
|
|
$client.Timeout = New-Object System.TimeSpan(0, 30, 0); `
|
|
|
|
$cancelTokenSource = [System.Threading.CancellationTokenSource]::new(); `
|
|
|
|
$responseMsg = $client.GetAsync([System.Uri]::new($source), $cancelTokenSource.Token); `
|
|
|
|
$responseMsg.Wait(); `
|
|
|
|
if (!$responseMsg.IsCanceled) { `
|
|
|
|
$response = $responseMsg.Result; `
|
|
|
|
if ($response.IsSuccessStatusCode) { `
|
|
|
|
$downloadedFileStream = [System.IO.FileStream]::new($target, [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write); `
|
|
|
|
$copyStreamOp = $response.Content.CopyToAsync($downloadedFileStream); `
|
|
|
|
$copyStreamOp.Wait(); `
|
|
|
|
$downloadedFileStream.Close(); `
|
|
|
|
if ($copyStreamOp.Exception -ne $null) { throw $copyStreamOp.Exception } `
|
|
|
|
} `
|
|
|
|
} else { `
|
|
|
|
Throw ("Failed to download " + $source) `
|
|
|
|
}`
|
|
|
|
} else { `
|
2020-09-20 11:37:56 +00:00
|
|
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
2016-11-17 21:54:56 +00:00
|
|
|
$webClient = New-Object System.Net.WebClient; `
|
|
|
|
$webClient.DownloadFile($source, $target); `
|
|
|
|
} `
|
2016-10-21 00:02:26 +00:00
|
|
|
} `
|
|
|
|
`
|
2020-09-21 19:21:22 +00:00
|
|
|
setx /M PATH $('C:\git\cmd;C:\git\usr\bin;'+$Env:PATH+';C:\gcc\bin;C:\go\bin;C:\containerd\bin'); `
|
2016-11-17 21:54:56 +00:00
|
|
|
`
|
2016-10-21 00:02:26 +00:00
|
|
|
Write-Host INFO: Downloading git...; `
|
2017-02-05 07:28:34 +00:00
|
|
|
$location='https://www.nuget.org/api/v2/package/GitForWindows/'+$Env:GIT_VERSION; `
|
|
|
|
Download-File $location C:\gitsetup.zip; `
|
2016-10-21 00:02:26 +00:00
|
|
|
`
|
|
|
|
Write-Host INFO: Downloading go...; `
|
2019-09-06 00:57:58 +00:00
|
|
|
$dlGoVersion=$Env:GO_VERSION -replace '\.0$',''; `
|
|
|
|
Download-File "https://golang.org/dl/go${dlGoVersion}.windows-amd64.zip" C:\go.zip; `
|
2016-10-21 00:02:26 +00:00
|
|
|
`
|
|
|
|
Write-Host INFO: Downloading compiler 1 of 3...; `
|
2019-09-26 09:59:51 +00:00
|
|
|
Download-File https://raw.githubusercontent.com/moby/docker-tdmgcc/master/gcc.zip C:\gcc.zip; `
|
2016-10-21 00:02:26 +00:00
|
|
|
`
|
|
|
|
Write-Host INFO: Downloading compiler 2 of 3...; `
|
2019-09-26 09:59:51 +00:00
|
|
|
Download-File https://raw.githubusercontent.com/moby/docker-tdmgcc/master/runtime.zip C:\runtime.zip; `
|
2016-10-21 00:02:26 +00:00
|
|
|
`
|
|
|
|
Write-Host INFO: Downloading compiler 3 of 3...; `
|
2019-09-26 09:59:51 +00:00
|
|
|
Download-File https://raw.githubusercontent.com/moby/docker-tdmgcc/master/binutils.zip C:\binutils.zip; `
|
2016-10-21 00:02:26 +00:00
|
|
|
`
|
2016-11-17 21:54:56 +00:00
|
|
|
Write-Host INFO: Extracting git...; `
|
2017-02-05 07:28:34 +00:00
|
|
|
Expand-Archive C:\gitsetup.zip C:\git-tmp; `
|
|
|
|
New-Item -Type Directory C:\git | Out-Null; `
|
|
|
|
Move-Item C:\git-tmp\tools\* C:\git\.; `
|
|
|
|
Remove-Item -Recurse -Force C:\git-tmp; `
|
2016-10-21 00:02:26 +00:00
|
|
|
`
|
2016-10-30 20:57:40 +00:00
|
|
|
Write-Host INFO: Expanding go...; `
|
|
|
|
Expand-Archive C:\go.zip -DestinationPath C:\; `
|
2016-10-21 00:02:26 +00:00
|
|
|
`
|
2016-11-17 21:54:56 +00:00
|
|
|
Write-Host INFO: Expanding compiler 1 of 3...; `
|
2016-10-30 20:57:40 +00:00
|
|
|
Expand-Archive C:\gcc.zip -DestinationPath C:\gcc -Force; `
|
2016-11-17 21:54:56 +00:00
|
|
|
Write-Host INFO: Expanding compiler 2 of 3...; `
|
2016-10-30 20:57:40 +00:00
|
|
|
Expand-Archive C:\runtime.zip -DestinationPath C:\gcc -Force; `
|
2016-11-17 21:54:56 +00:00
|
|
|
Write-Host INFO: Expanding compiler 3 of 3...; `
|
2016-10-30 20:57:40 +00:00
|
|
|
Expand-Archive C:\binutils.zip -DestinationPath C:\gcc -Force; `
|
2016-10-21 00:02:26 +00:00
|
|
|
`
|
2016-11-17 21:54:56 +00:00
|
|
|
Write-Host INFO: Removing downloaded files...; `
|
|
|
|
Remove-Item C:\gcc.zip; `
|
|
|
|
Remove-Item C:\runtime.zip; `
|
|
|
|
Remove-Item C:\binutils.zip; `
|
2017-02-05 07:28:34 +00:00
|
|
|
Remove-Item C:\gitsetup.zip; `
|
2016-11-17 21:54:56 +00:00
|
|
|
`
|
2020-09-21 19:21:22 +00:00
|
|
|
Write-Host INFO: Downloading containerd; `
|
|
|
|
Install-Package -Force 7Zip4PowerShell; `
|
2022-06-30 09:24:46 +00:00
|
|
|
$location='https://github.com/containerd/containerd/releases/download/'+$Env:CONTAINERD_VERSION+'/containerd-'+$Env:CONTAINERD_VERSION.TrimStart('v')+'-windows-amd64.tar.gz'; `
|
2020-09-21 19:21:22 +00:00
|
|
|
Download-File $location C:\containerd.tar.gz; `
|
|
|
|
New-Item -Path C:\containerd -ItemType Directory; `
|
|
|
|
Expand-7Zip C:\containerd.tar.gz C:\; `
|
|
|
|
Expand-7Zip C:\containerd.tar C:\containerd; `
|
|
|
|
Remove-Item C:\containerd.tar.gz; `
|
|
|
|
Remove-Item C:\containerd.tar; `
|
|
|
|
`
|
2019-10-08 01:14:51 +00:00
|
|
|
# Ensure all directories exist that we will require below....
|
|
|
|
$srcDir = """$Env:GOPATH`\src\github.com\docker\docker\bundles"""; `
|
|
|
|
Write-Host INFO: Ensuring existence of directory $srcDir...; `
|
|
|
|
New-Item -Force -ItemType Directory -Path $srcDir | Out-Null; `
|
2016-11-17 21:54:56 +00:00
|
|
|
`
|
|
|
|
Write-Host INFO: Configuring git core.autocrlf...; `
|
2019-10-08 01:14:51 +00:00
|
|
|
C:\git\cmd\git config --global core.autocrlf true;
|
|
|
|
|
|
|
|
RUN `
|
2021-07-26 12:56:29 +00:00
|
|
|
Function Install-GoTestSum() { `
|
2020-06-24 19:50:49 +00:00
|
|
|
$Env:GO111MODULE = 'on'; `
|
|
|
|
$tmpGobin = "${Env:GOBIN_TMP}"; `
|
|
|
|
$Env:GOBIN = """${Env:GOPATH}`\bin"""; `
|
2021-07-26 12:56:29 +00:00
|
|
|
Write-Host "INFO: Installing gotestsum version $Env:GOTESTSUM_VERSION in $Env:GOBIN"; `
|
|
|
|
&go install "gotest.tools/gotestsum@${Env:GOTESTSUM_VERSION}"; `
|
2020-06-24 19:50:49 +00:00
|
|
|
$Env:GOBIN = "${tmpGobin}"; `
|
|
|
|
$Env:GO111MODULE = 'off'; `
|
2020-05-16 16:41:46 +00:00
|
|
|
if ($LASTEXITCODE -ne 0) { `
|
2021-07-26 12:56:29 +00:00
|
|
|
Throw '"gotestsum install failed..."'; `
|
2019-10-08 01:14:51 +00:00
|
|
|
} `
|
|
|
|
} `
|
2016-11-17 21:54:56 +00:00
|
|
|
`
|
2021-07-26 12:56:29 +00:00
|
|
|
Install-GoTestSum
|
2016-04-23 22:11:08 +00:00
|
|
|
|
2022-04-12 11:15:54 +00:00
|
|
|
RUN `
|
|
|
|
Function Install-GoWinres() { `
|
|
|
|
$Env:GO111MODULE = 'on'; `
|
|
|
|
$tmpGobin = "${Env:GOBIN_TMP}"; `
|
|
|
|
$Env:GOBIN = """${Env:GOPATH}`\bin"""; `
|
|
|
|
Write-Host "INFO: Installing go-winres version $Env:GOWINRES_VERSION in $Env:GOBIN"; `
|
|
|
|
&go install "github.com/tc-hib/go-winres@${Env:GOWINRES_VERSION}"; `
|
|
|
|
$Env:GOBIN = "${tmpGobin}"; `
|
|
|
|
$Env:GO111MODULE = 'off'; `
|
|
|
|
if ($LASTEXITCODE -ne 0) { `
|
|
|
|
Throw '"go-winres install failed..."'; `
|
|
|
|
} `
|
|
|
|
} `
|
|
|
|
`
|
|
|
|
Install-GoWinres
|
|
|
|
|
2016-11-17 21:54:56 +00:00
|
|
|
# Make PowerShell the default entrypoint
|
|
|
|
ENTRYPOINT ["powershell.exe"]
|
|
|
|
|
|
|
|
# Set the working directory to the location of the sources
|
2019-09-09 23:19:03 +00:00
|
|
|
WORKDIR ${GOPATH}\src\github.com\docker\docker
|
2016-01-21 02:51:34 +00:00
|
|
|
|
2016-11-17 21:54:56 +00:00
|
|
|
# Copy the sources into the container
|
|
|
|
COPY . .
|