Skip to content

Add "$ProgressPreference = 'SilentlyContinue';" to Windows-based variants #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 1, 2016

Conversation

tianon
Copy link
Member

@tianon tianon commented Dec 1, 2016

As pointed out by @StefanScherer in #116 (comment). 👍 ❤️

See also PowerShell/PowerShell#2138 (comment) (linked in a comment within this change) for more details.

@StefanScherer
Copy link

LGTM :-) Keeps the rest of the Dockerfile clean.

@tianon
Copy link
Member Author

tianon commented Dec 1, 2016

Indeed 👍

Here's some of the build output (just to show that this really does work, and doesn't break the build):

$ docker build 'https://raw.githubusercontent.com/infosiftr/golang/803439af1f04d215135fff8ca406761ead9f06af/1.8/windows/windowsservercore/Dockerfile'
Downloading build context from remote url: https://raw.githubusercontent.com/infosiftr/golang/803439af1f04d215135fff8ca406761ead9f06af/1.8/windows/windowsserverDownloading build context from remote url: https://raw.githubusercontent.com/infosiftr/golang/803439af1f04d215135fff8ca406761ead9f06af/1.8/windows/windowsservercore/Dockerfile 3.526 kB
Sending build context to Docker daemon  5.12 kB
Step 1/14 : FROM microsoft/windowsservercore
 ---> f49a4ea104f1
Step 2/14 : SHELL powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';
 ---> Running in 0fb6ecb9555c
 ---> 1da716bfb422
Removing intermediate container 0fb6ecb9555c
Step 3/14 : ENV GIT_VERSION 2.9.2
 ---> Running in 7c62a775cf1f
 ---> 8aa50eb3635c
Removing intermediate container 7c62a775cf1f
Step 4/14 : ENV GIT_TAG v${GIT_VERSION}.windows.1
 ---> Running in 6d74695b5ada
 ---> c0897bd058f6
Removing intermediate container 6d74695b5ada
Step 5/14 : ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/Git-${GIT_VERSION}-64-bit.exe
 ---> Running in dd35b92c4156
 ---> 89715b743df6
Removing intermediate container dd35b92c4156
Step 6/14 : ENV GIT_DOWNLOAD_SHA256 006d971bcbe73cc8d841a100a4eb20d22e135142bf5b0f2120722fd420e166e5
 ---> Running in 94c47dba1bb7
 ---> 523305cff712
Removing intermediate container 94c47dba1bb7
Step 7/14 : RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL);   Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile 'git.exe';                Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256);   if ((Get-FileHash git.exe -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) {      Write-Host 'FAILED!';            exit 1;         };              Write-Host 'Installing ...';    Start-Process           -Wait           -FilePath ./git.exe    -ArgumentList @(                         '/VERYSILENT',                  '/NORESTART',                   '/NOCANCEL',                    '/SP-',                '/SUPPRESSMSGBOXES',                                             '/COMPONENTS=assoc_sh',                                                 '/DIR=C:\git'          );               Write-Host 'Updating PATH ...';         $env:PATH = 'C:\git\bin;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH;        [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);        Write-Host 'Verifying install ...';      Write-Host '  git --version'; git --version;    Write-Host '  bash --version'; bash --version;  Write-Host '  curl --version'; curl.exe --version;              Write-Host 'Removing installer ...';   Remove-Item git.exe -Force;              Write-Host 'Complete.';
 ---> Running in d33cac2dded5
Downloading https://github.com/git-for-windows/git/releases/download/v2.9.2.windows.1/Git-2.9.2-64-bit.exe ...
Verifying sha256 (006d971bcbe73cc8d841a100a4eb20d22e135142bf5b0f2120722fd420e166e5) ...
Installing ...
Updating PATH ...
Verifying install ...
...
$ docker build 'https://raw.githubusercontent.com/infosiftr/golang/803439af1f04d215135fff8ca406761ead9f06af/1.8/windows/nanoserver/Dockerfile'
Downloading build context from remote url: https://raw.githubusercontent.com/infosiftr/golang/803439af1f04d215135fff8ca406761ead9f06af/1.8/windows/nanoserver/DoDownloading build context from remote url: https://raw.githubusercontent.com/infosiftr/golang/803439af1f04d215135fff8ca406761ead9f06af/1.8/windows/nanoserver/Dockerfile 1.652 kB
Sending build context to Docker daemon 3.584 kB
Step 1/9 : FROM microsoft/nanoserver
 ---> 787d9f9f8804
Step 2/9 : SHELL powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';
 ---> Running in 1786686054a4
 ---> f68134b58739
Removing intermediate container 1786686054a4
Step 3/9 : ENV GOPATH C:\\gopath
 ---> Running in dafd0b198c3b
 ---> dfd658b33527
Removing intermediate container dafd0b198c3b
Step 4/9 : RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); Write-Host ('Updating PATH: {0}' -f $newPath);   setx /M PATH $newPath;
 ---> Running in 985bf054639e
Updating PATH: C:\gopath\bin;C:\go\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps

SUCCESS: Specified value was saved.
 ---> 7f2e54e78a33
Removing intermediate container 985bf054639e
Step 5/9 : ENV GOLANG_VERSION 1.8beta1
 ---> Running in 844ffdd47ce5
 ---> 029dd8ffde1e
Removing intermediate container 844ffdd47ce5
Step 6/9 : ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip
 ---> Running in 27ec0c9b2400
 ---> 38ec60c7aefe
Removing intermediate container 27ec0c9b2400
Step 7/9 : ENV GOLANG_DOWNLOAD_SHA256 7b246c37dfe37348a16b6bc1865ebc21a79c4fd869032fba78c65e46b11b741b
 ---> Running in 0e31f203266e
 ---> 85ccb3914682
Removing intermediate container 0e31f203266e
Step 8/9 : RUN Write-Host ('Downloading {0} ...' -f $env:GOLANG_DOWNLOAD_URL); Invoke-WebRequest -Uri $env:GOLANG_DOWNLOAD_URL -OutFile 'go.zip';              Write-Host ('Verifying sha256 ({0}) ...' -f $env:GOLANG_DOWNLOAD_SHA256);       if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $env:GOLANG_DOWNLOAD_SHA256) {              Write-Host 'FAILED!';           exit 1;         };             Write-Host 'Expanding ...';      Expand-Archive go.zip -DestinationPath C:\;    Write-Host 'Verifying install ("go version") ...';       go version;            Write-Host 'Removing ...';       Remove-Item go.zip -Force;              Write-Host 'Complete.';
 ---> Running in 15b62e81ab78
Downloading https://golang.org/dl/go1.8beta1.windows-amd64.zip ...
Verifying sha256 (7b246c37dfe37348a16b6bc1865ebc21a79c4fd869032fba78c65e46b11b741b) ...
Expanding ...
Verifying install (go version) ...
go version go1.8beta1 windows/amd64
Removing ...
Complete.
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants