Unlike Linux which uses a temp dir as GOPATH, Windows
uses c:\go. Among other things, this blocks go get.
Moving GOPATH to c:\gopath and updating references in
comments and documentation.
Currently the change is being scoped narrowly. In the
future GOPATH value could be passed as a parameter to
the ps1 scripts.
Signed-off-by: Vikram bir Singh <vikrambir.singh@docker.com>
... | ... |
@@ -45,8 +45,8 @@ |
45 | 45 |
# |
46 | 46 |
# 1. Clone the sources from github.com: |
47 | 47 |
# |
48 |
-# >> git clone https://github.com/docker/docker.git C:\go\src\github.com\docker\docker |
|
49 |
-# >> Cloning into 'C:\go\src\github.com\docker\docker'... |
|
48 |
+# >> git clone https://github.com/docker/docker.git C:\gopath\src\github.com\docker\docker |
|
49 |
+# >> Cloning into 'C:\gopath\src\github.com\docker\docker'... |
|
50 | 50 |
# >> remote: Counting objects: 186216, done. |
51 | 51 |
# >> remote: Compressing objects: 100% (21/21), done. |
52 | 52 |
# >> remote: Total 186216 (delta 5), reused 0 (delta 0), pack-reused 186195 |
... | ... |
@@ -59,7 +59,7 @@ |
59 | 59 |
# |
60 | 60 |
# 2. Change directory to the cloned docker sources: |
61 | 61 |
# |
62 |
-# >> cd C:\go\src\github.com\docker\docker |
|
62 |
+# >> cd C:\gopath\src\github.com\docker\docker |
|
63 | 63 |
# |
64 | 64 |
# |
65 | 65 |
# 3. Build a docker image with the components required to build the docker binaries from source |
... | ... |
@@ -79,8 +79,8 @@ |
79 | 79 |
# 5. Copy the binaries out of the container, replacing HostPath with an appropriate destination |
80 | 80 |
# folder on the host system where you want the binaries to be located. |
81 | 81 |
# |
82 |
-# >> docker cp binaries:C:\go\src\github.com\docker\docker\bundles\docker.exe C:\HostPath\docker.exe |
|
83 |
-# >> docker cp binaries:C:\go\src\github.com\docker\docker\bundles\dockerd.exe C:\HostPath\dockerd.exe |
|
82 |
+# >> docker cp binaries:C:\gopath\src\github.com\docker\docker\bundles\docker.exe C:\HostPath\docker.exe |
|
83 |
+# >> docker cp binaries:C:\gopath\src\github.com\docker\docker\bundles\dockerd.exe C:\HostPath\dockerd.exe |
|
84 | 84 |
# |
85 | 85 |
# |
86 | 86 |
# 6. (Optional) Remove the interim container holding the built executable binaries: |
... | ... |
@@ -172,7 +172,7 @@ ARG GO_VERSION=1.12.9 |
172 | 172 |
# - FROM_DOCKERFILE is used for detection of building within a container. |
173 | 173 |
ENV GO_VERSION=${GO_VERSION} ` |
174 | 174 |
GIT_VERSION=2.11.1 ` |
175 |
- GOPATH=C:\go ` |
|
175 |
+ GOPATH=C:\gopath ` |
|
176 | 176 |
FROM_DOCKERFILE=1 |
177 | 177 |
|
178 | 178 |
RUN ` |
... | ... |
@@ -248,7 +248,7 @@ RUN ` |
248 | 248 |
Remove-Item C:\gitsetup.zip; ` |
249 | 249 |
` |
250 | 250 |
Write-Host INFO: Creating source directory...; ` |
251 |
- New-Item -ItemType Directory -Path C:\go\src\github.com\docker\docker | Out-Null; ` |
|
251 |
+ New-Item -ItemType Directory -Path ${GOPATH}\src\github.com\docker\docker | Out-Null; ` |
|
252 | 252 |
` |
253 | 253 |
Write-Host INFO: Configuring git core.autocrlf...; ` |
254 | 254 |
C:\git\cmd\git config --global core.autocrlf true; ` |
... | ... |
@@ -259,7 +259,7 @@ RUN ` |
259 | 259 |
ENTRYPOINT ["powershell.exe"] |
260 | 260 |
|
261 | 261 |
# Set the working directory to the location of the sources |
262 |
-WORKDIR C:\go\src\github.com\docker\docker |
|
262 |
+WORKDIR ${GOPATH}\src\github.com\docker\docker |
|
263 | 263 |
|
264 | 264 |
# Copy the sources into the container |
265 | 265 |
COPY . . |
... | ... |
@@ -100,8 +100,8 @@ To build Moby, run: |
100 | 100 |
Copy out the resulting Windows Moby Engine binary to `dockerd.exe` in the |
101 | 101 |
current directory: |
102 | 102 |
|
103 |
- docker cp binaries:C:\go\src\github.com\docker\docker\bundles\docker.exe docker.exe |
|
104 |
- docker cp binaries:C:\go\src\github.com\docker\docker\bundles\dockerd.exe dockerd.exe |
|
103 |
+ docker cp binaries:C:\gopath\src\github.com\docker\docker\bundles\docker.exe docker.exe |
|
104 |
+ docker cp binaries:C:\gopath\src\github.com\docker\docker\bundles\dockerd.exe dockerd.exe |
|
105 | 105 |
|
106 | 106 |
To test it, stop the system Docker daemon and start the one you just built: |
107 | 107 |
|
... | ... |
@@ -109,7 +109,7 @@ To test it, stop the system Docker daemon and start the one you just built: |
109 | 109 |
.\dockerd.exe -D |
110 | 110 |
|
111 | 111 |
The other make targets work too, to run unit tests try: |
112 |
-`docker run --rm docker-builder sh -c 'cd /c/go/src/github.com/docker/docker; hack/make.sh test-unit'`. |
|
112 |
+`docker run --rm docker-builder sh -c 'cd /c/gopath/src/github.com/docker/docker; hack/make.sh test-unit'`. |
|
113 | 113 |
|
114 | 114 |
### 6. Remove the interim binaries container |
115 | 115 |
|
... | ... |
@@ -462,7 +462,7 @@ Try { |
462 | 462 |
} |
463 | 463 |
|
464 | 464 |
# Following at the moment must be docker\docker as it's dictated by dockerfile.Windows |
465 |
- $contPath="$COMMITHASH`:c`:\go\src\github.com\docker\docker\bundles" |
|
465 |
+ $contPath="$COMMITHASH`:c`:\gopath\src\github.com\docker\docker\bundles" |
|
466 | 466 |
|
467 | 467 |
# After https://github.com/docker/docker/pull/30290, .git was added to .dockerignore. Therefore |
468 | 468 |
# we have to calculate unsupported outside of the container, and pass the commit ID in through |
... | ... |
@@ -817,7 +817,7 @@ Try { |
817 | 817 |
$Duration= $(Measure-Command { & docker run ` |
818 | 818 |
--rm ` |
819 | 819 |
-e c=$c ` |
820 |
- --workdir "c`:\go\src\github.com\docker\docker\integration-cli" ` |
|
820 |
+ --workdir "c`:\gopath\src\github.com\docker\docker\integration-cli" ` |
|
821 | 821 |
-v "$env:TEMP\binary`:c:\target" ` |
822 | 822 |
docker ` |
823 | 823 |
"`$env`:PATH`='c`:\target;'+`$env:PATH`; `$env:DOCKER_HOST`='tcp`://'+(ipconfig | select -last 1).Substring(39)+'`:2357'; c:\target\runIntegrationCLI.ps1" | Out-Host } ) |