Skip to content

Conversation

tianon
Copy link
Member

@tianon tianon commented Jul 19, 2021

Changes:

Changes:

- docker-library/golang@91fcb9a: Merge pull request docker-library/golang#377 from infosiftr/go-1.17-windows
- docker-library/golang@272431a: For Go 1.17+, move the Windows install to C:\Program Files\Go
@github-actions
Copy link

Diff for e932072:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 406beb5..fc8c06e 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -20,7 +20,7 @@ Directory: 1.15/buster
 Tags: 1.15.14-nanoserver-1809, 1.15-nanoserver-1809
 SharedTags: 1.15.14-nanoserver, 1.15-nanoserver
 Architectures: windows-amd64
-GitCommit: d23c409d5096cd3e6b18d977e1f70473e2726461
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.15/windows/nanoserver-1809
 Constraints: nanoserver-1809, windowsservercore-1809
 
@@ -32,14 +32,14 @@ Directory: 1.15/stretch
 Tags: 1.15.14-windowsservercore-1809, 1.15-windowsservercore-1809
 SharedTags: 1.15.14-windowsservercore, 1.15-windowsservercore, 1.15.14, 1.15
 Architectures: windows-amd64
-GitCommit: d23c409d5096cd3e6b18d977e1f70473e2726461
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.15/windows/windowsservercore-1809
 Constraints: windowsservercore-1809
 
 Tags: 1.15.14-windowsservercore-ltsc2016, 1.15-windowsservercore-ltsc2016
 SharedTags: 1.15.14-windowsservercore, 1.15-windowsservercore, 1.15.14, 1.15
 Architectures: windows-amd64
-GitCommit: d23c409d5096cd3e6b18d977e1f70473e2726461
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.15/windows/windowsservercore-ltsc2016
 Constraints: windowsservercore-ltsc2016
 
@@ -62,7 +62,7 @@ Directory: 1.16/buster
 Tags: 1.16.6-nanoserver-1809, 1.16-nanoserver-1809, 1-nanoserver-1809, nanoserver-1809
 SharedTags: 1.16.6-nanoserver, 1.16-nanoserver, 1-nanoserver, nanoserver
 Architectures: windows-amd64
-GitCommit: 54aa949c354b1e14cb636539f401b0e58ca76927
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.16/windows/nanoserver-1809
 Constraints: nanoserver-1809, windowsservercore-1809
 
@@ -74,14 +74,14 @@ Directory: 1.16/stretch
 Tags: 1.16.6-windowsservercore-1809, 1.16-windowsservercore-1809, 1-windowsservercore-1809, windowsservercore-1809
 SharedTags: 1.16.6-windowsservercore, 1.16-windowsservercore, 1-windowsservercore, windowsservercore, 1.16.6, 1.16, 1, latest
 Architectures: windows-amd64
-GitCommit: 54aa949c354b1e14cb636539f401b0e58ca76927
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.16/windows/windowsservercore-1809
 Constraints: windowsservercore-1809
 
 Tags: 1.16.6-windowsservercore-ltsc2016, 1.16-windowsservercore-ltsc2016, 1-windowsservercore-ltsc2016, windowsservercore-ltsc2016
 SharedTags: 1.16.6-windowsservercore, 1.16-windowsservercore, 1-windowsservercore, windowsservercore, 1.16.6, 1.16, 1, latest
 Architectures: windows-amd64
-GitCommit: 54aa949c354b1e14cb636539f401b0e58ca76927
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.16/windows/windowsservercore-ltsc2016
 Constraints: windowsservercore-ltsc2016
 
@@ -104,7 +104,7 @@ Directory: 1.17-rc/buster
 Tags: 1.17rc1-nanoserver-1809, 1.17-rc-nanoserver-1809, rc-nanoserver-1809
 SharedTags: 1.17rc1-nanoserver, 1.17-rc-nanoserver, rc-nanoserver
 Architectures: windows-amd64
-GitCommit: 7f1f587018139127c0dc71bc276ca7b0609847f4
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.17-rc/windows/nanoserver-1809
 Constraints: nanoserver-1809, windowsservercore-1809
 
@@ -116,13 +116,13 @@ Directory: 1.17-rc/stretch
 Tags: 1.17rc1-windowsservercore-1809, 1.17-rc-windowsservercore-1809, rc-windowsservercore-1809
 SharedTags: 1.17rc1-windowsservercore, 1.17-rc-windowsservercore, rc-windowsservercore, 1.17rc1, 1.17-rc, rc
 Architectures: windows-amd64
-GitCommit: 7f1f587018139127c0dc71bc276ca7b0609847f4
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.17-rc/windows/windowsservercore-1809
 Constraints: windowsservercore-1809
 
 Tags: 1.17rc1-windowsservercore-ltsc2016, 1.17-rc-windowsservercore-ltsc2016, rc-windowsservercore-ltsc2016
 SharedTags: 1.17rc1-windowsservercore, 1.17-rc-windowsservercore, rc-windowsservercore, 1.17rc1, 1.17-rc, rc
 Architectures: windows-amd64
-GitCommit: 7f1f587018139127c0dc71bc276ca7b0609847f4
+GitCommit: 272431aeb4d1e2235a36d1aa64e76f0977a720cc
 Directory: 1.17-rc/windows/windowsservercore-ltsc2016
 Constraints: windowsservercore-ltsc2016
diff --git a/golang_1.15-nanoserver-1809/Dockerfile b/golang_1.15-nanoserver-1809/Dockerfile
index 16f6941..98fc6de 100644
--- a/golang_1.15-nanoserver-1809/Dockerfile
+++ b/golang_1.15-nanoserver-1809/Dockerfile
@@ -11,8 +11,9 @@ SHELL ["cmd", "/S", "/C"]
 # no Git installed (intentionally)
 #  -- Nano Server is "Windows Slim"
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go was the default install path for Go itself on Windows
 ENV GOPATH C:\\gopath
+# (https://golang.org/cl/283600)
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
 USER ContainerAdministrator
@@ -22,7 +23,8 @@ USER ContainerUser
 
 ENV GOLANG_VERSION 1.15.14
 
-COPY --from=golang:1.15.14-windowsservercore-1809 C:\\go C:\\go
+# Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon
+COPY --from=golang:1.15.14-windowsservercore-1809 ["C:\\\\go","C:\\\\go"]
 RUN go version
 
 WORKDIR $GOPATH
diff --git a/golang_1.15-windowsservercore-1809/Dockerfile b/golang_1.15-windowsservercore-1809/Dockerfile
index a5626f7..79246b9 100644
--- a/golang_1.15-windowsservercore-1809/Dockerfile
+++ b/golang_1.15-windowsservercore-1809/Dockerfile
@@ -43,8 +43,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
 	\
 	Write-Host 'Complete.';
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go was the default install path for Go itself on Windows
 ENV GOPATH C:\\gopath
+# (https://golang.org/cl/283600)
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
 RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
diff --git a/golang_1.15-windowsservercore-ltsc2016/Dockerfile b/golang_1.15-windowsservercore-ltsc2016/Dockerfile
index 2af7c1f..02df889 100644
--- a/golang_1.15-windowsservercore-ltsc2016/Dockerfile
+++ b/golang_1.15-windowsservercore-ltsc2016/Dockerfile
@@ -43,8 +43,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
 	\
 	Write-Host 'Complete.';
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go was the default install path for Go itself on Windows
 ENV GOPATH C:\\gopath
+# (https://golang.org/cl/283600)
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
 RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
diff --git a/golang_nanoserver-1809/Dockerfile b/golang_nanoserver-1809/Dockerfile
index 79ba6b4..0f60acc 100644
--- a/golang_nanoserver-1809/Dockerfile
+++ b/golang_nanoserver-1809/Dockerfile
@@ -11,8 +11,9 @@ SHELL ["cmd", "/S", "/C"]
 # no Git installed (intentionally)
 #  -- Nano Server is "Windows Slim"
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go was the default install path for Go itself on Windows
 ENV GOPATH C:\\gopath
+# (https://golang.org/cl/283600)
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
 USER ContainerAdministrator
@@ -22,7 +23,8 @@ USER ContainerUser
 
 ENV GOLANG_VERSION 1.16.6
 
-COPY --from=golang:1.16.6-windowsservercore-1809 C:\\go C:\\go
+# Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon
+COPY --from=golang:1.16.6-windowsservercore-1809 ["C:\\\\go","C:\\\\go"]
 RUN go version
 
 WORKDIR $GOPATH
diff --git a/golang_rc-nanoserver-1809/Dockerfile b/golang_rc-nanoserver-1809/Dockerfile
index 6abc1d2..f516396 100644
--- a/golang_rc-nanoserver-1809/Dockerfile
+++ b/golang_rc-nanoserver-1809/Dockerfile
@@ -11,18 +11,20 @@ SHELL ["cmd", "/S", "/C"]
 # no Git installed (intentionally)
 #  -- Nano Server is "Windows Slim"
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
-ENV GOPATH C:\\gopath
+# for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288)
+ENV GOPATH C:\\go
+# HOWEVER, please note that it is the Go upstream intention to remove GOPATH support entirely: https://blog.golang.org/go116-module-changes
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
 USER ContainerAdministrator
-RUN setx /m PATH "%GOPATH%\bin;C:\go\bin;%PATH%"
+RUN setx /m PATH "%GOPATH%\bin;C:\Program Files\Go\bin;%PATH%"
 USER ContainerUser
 # doing this first to share cache across versions more aggressively
 
 ENV GOLANG_VERSION 1.17rc1
 
-COPY --from=golang:1.17rc1-windowsservercore-1809 C:\\go C:\\go
+# Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon
+COPY --from=golang:1.17rc1-windowsservercore-1809 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"]
 RUN go version
 
 WORKDIR $GOPATH
diff --git a/golang_rc-windowsservercore-1809/Dockerfile b/golang_rc-windowsservercore-1809/Dockerfile
index 2fbf068..f14c056 100644
--- a/golang_rc-windowsservercore-1809/Dockerfile
+++ b/golang_rc-windowsservercore-1809/Dockerfile
@@ -43,11 +43,12 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
 	\
 	Write-Host 'Complete.';
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
-ENV GOPATH C:\\gopath
+# for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288)
+ENV GOPATH C:\\go
+# HOWEVER, please note that it is the Go upstream intention to remove GOPATH support entirely: https://blog.golang.org/go116-module-changes
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
-RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
+RUN $newPath = ('{0}\bin;C:\Program Files\Go\bin;{1}' -f $env:GOPATH, $env:PATH); \
 	Write-Host ('Updating PATH: {0}' -f $newPath); \
 	[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
 # doing this first to share cache across versions more aggressively
@@ -68,6 +69,9 @@ RUN $url = 'https://dl.google.com/go/go1.17rc1.windows-amd64.zip'; \
 	Write-Host 'Expanding ...'; \
 	Expand-Archive go.zip -DestinationPath C:\; \
 	\
+	Write-Host 'Moving ...'; \
+	Move-Item -Path C:\go -Destination 'C:\Program Files\Go'; \
+	\
 	Write-Host 'Removing ...'; \
 	Remove-Item go.zip -Force; \
 	\
diff --git a/golang_rc-windowsservercore-ltsc2016/Dockerfile b/golang_rc-windowsservercore-ltsc2016/Dockerfile
index 6b7e72a..dd250b5 100644
--- a/golang_rc-windowsservercore-ltsc2016/Dockerfile
+++ b/golang_rc-windowsservercore-ltsc2016/Dockerfile
@@ -43,11 +43,12 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
 	\
 	Write-Host 'Complete.';
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
-ENV GOPATH C:\\gopath
+# for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288)
+ENV GOPATH C:\\go
+# HOWEVER, please note that it is the Go upstream intention to remove GOPATH support entirely: https://blog.golang.org/go116-module-changes
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
-RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
+RUN $newPath = ('{0}\bin;C:\Program Files\Go\bin;{1}' -f $env:GOPATH, $env:PATH); \
 	Write-Host ('Updating PATH: {0}' -f $newPath); \
 	[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
 # doing this first to share cache across versions more aggressively
@@ -68,6 +69,9 @@ RUN $url = 'https://dl.google.com/go/go1.17rc1.windows-amd64.zip'; \
 	Write-Host 'Expanding ...'; \
 	Expand-Archive go.zip -DestinationPath C:\; \
 	\
+	Write-Host 'Moving ...'; \
+	Move-Item -Path C:\go -Destination 'C:\Program Files\Go'; \
+	\
 	Write-Host 'Removing ...'; \
 	Remove-Item go.zip -Force; \
 	\
diff --git a/golang_windowsservercore-1809/Dockerfile b/golang_windowsservercore-1809/Dockerfile
index a84e7b6..f16e746 100644
--- a/golang_windowsservercore-1809/Dockerfile
+++ b/golang_windowsservercore-1809/Dockerfile
@@ -43,8 +43,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
 	\
 	Write-Host 'Complete.';
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go was the default install path for Go itself on Windows
 ENV GOPATH C:\\gopath
+# (https://golang.org/cl/283600)
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
 RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
diff --git a/golang_windowsservercore-ltsc2016/Dockerfile b/golang_windowsservercore-ltsc2016/Dockerfile
index 23370b9..1775f91 100644
--- a/golang_windowsservercore-ltsc2016/Dockerfile
+++ b/golang_windowsservercore-ltsc2016/Dockerfile
@@ -43,8 +43,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
 	\
 	Write-Host 'Complete.';
 
-# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go was the default install path for Go itself on Windows
 ENV GOPATH C:\\gopath
+# (https://golang.org/cl/283600)
 
 # PATH isn't actually set in the Docker image, so we have to set it from within the container
 RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \

@yosifkit yosifkit merged commit d6170a9 into docker-library:master Jul 20, 2021
@yosifkit yosifkit deleted the golang branch July 20, 2021 17:25
@docker-library-bot docker-library-bot restored the golang branch July 20, 2021 17:29
@tianon tianon deleted the golang branch July 20, 2021 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants