Skip to content

Commit e174bf9

Browse files
Merge pull request #131 from StefanScherer/golang-issue-18555
Add test for golang/go#18555
2 parents 301c4dd + 7faab81 commit e174bf9

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

golang-issue-18555/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM golang:1.8-windowsservercore
2+
RUN mv /go /go1.8.1
3+
WORKDIR /
4+
RUN git clone https://github.com/golang/go
5+
WORKDIR /go/src
6+
ENV GOROOT_BOOTSTRAP C:/go1.8.1
7+
ENV CGO_ENABLED 0
8+
RUN git fetch https://go.googlesource.com/go refs/changes/34/41834/3 ; \
9+
git checkout FETCH_HEAD
10+
RUN cmd /C make.bat

golang-issue-18555/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Golang issue 18555
2+
3+
This is a test for [golang/go#18555](https://github.com/golang/go/issues/18555): cmd/go: build inside a Windows container does not find the sources in mounted volume
4+
5+
See if latest master branch fixes this issue. Let's test it on AppVeyor.

golang-issue-18555/build.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker build -t golang-issue-18555 .

golang-issue-18555/test.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Write-Host Testing new golang image to build on volume mountpoint
2+
Write-Host The webserver dir before running the go build:
3+
dir ..\webserver
4+
Write-Host Building a Go binary inside a container.
5+
docker run -v "$(pwd)\..\webserver:C:\code" -w /code golang-issue-18555 go build webserver.go
6+
Write-Host The webserver dir after running the go build:
7+
dir ..\webserver
8+
if (!(Test-Path ..\webserver\webserver.exe)) {
9+
Write-Error "webserver.exe is missing, go build didn't work in container."
10+
} else {
11+
Write-Host "webserver.exe found, go build works in a container."
12+
}

0 commit comments

Comments
 (0)