Skip to content

Instantly share code, notes, and snippets.

@StefanScherer
Created April 28, 2017 19:55
Show Gist options
  • Save StefanScherer/ef596640cee1c37519bb9a5a437b44a0 to your computer and use it in GitHub Desktop.
Save StefanScherer/ef596640cee1c37519bb9a5a437b44a0 to your computer and use it in GitHub Desktop.
Build Golang for Windows in a Windows container
FROM golang:1.8-windowsservercore
WORKDIR /compile
RUN git clone https://github.com/golang/go
WORKDIR /compile/go/src
ENV GOROOT_BOOTSTRAP C:/go
ENV CGO_ENABLED 0
RUN cmd /C all.bat
RUN cp ..\bin\*.exe \go\bin
$ docker build -t golang-builder .
Sending build context to Docker daemon 2.048 kB
Step 1/7 : FROM golang:1.8-windowsservercore
---> 07c195afaf3e
Step 2/7 : WORKDIR /compile
---> Using cache
---> ac7b746ff58e
Step 3/7 : RUN git clone https://github.com/golang/go
---> Using cache
---> 85ce1420a1be
Step 4/7 : WORKDIR /compile/go/src
---> Using cache
---> 6630c4b7d7e7
Step 5/7 : ENV GOROOT_BOOTSTRAP C:/go
---> Using cache
---> b4c2f7ab91f4
Step 6/7 : ENV CGO_ENABLED 0
---> Running in 0bc6b87cb603
---> 81d987c6bdd8
Removing intermediate container 0bc6b87cb603
Step 7/7 : RUN cmd /C all.bat
---> Running in 8123dd479ecc
##### Building Go bootstrap tool.
cmd/dist
##### Building Go toolchain using C:/go.
bootstrap/cmd/internal/dwarf
bootstrap/cmd/internal/objabi
bootstrap/cmd/internal/src
bootstrap/cmd/internal/sys
bootstrap/cmd/asm/internal/flags
bootstrap/cmd/internal/obj
bootstrap/cmd/asm/internal/lex
bootstrap/cmd/internal/bio
bootstrap/cmd/internal/obj/arm
bootstrap/cmd/internal/obj/arm64
bootstrap/cmd/internal/obj/mips
bootstrap/cmd/internal/obj/ppc64
bootstrap/cmd/internal/obj/s390x
bootstrap/cmd/internal/obj/x86
bootstrap/math/bits
bootstrap/math/big
bootstrap/cmd/asm/internal/arch
bootstrap/cmd/asm/internal/asm
bootstrap/cmd/compile/internal/ssa
bootstrap/cmd/asm
bootstrap/cmd/compile/internal/syntax
bootstrap/cmd/internal/gcprog
bootstrap/debug/pe
bootstrap/cmd/link/internal/ld
bootstrap/cmd/link/internal/amd64
bootstrap/cmd/link/internal/arm
bootstrap/cmd/link/internal/arm64
bootstrap/cmd/link/internal/mips
bootstrap/cmd/link/internal/mips64
bootstrap/cmd/link/internal/ppc64
bootstrap/cmd/link/internal/s390x
bootstrap/cmd/link/internal/x86
bootstrap/cmd/link
bootstrap/cmd/compile/internal/types
bootstrap/cmd/compile/internal/gc
bootstrap/cmd/compile/internal/amd64
bootstrap/cmd/compile/internal/arm
bootstrap/cmd/compile/internal/arm64
bootstrap/cmd/compile/internal/mips
bootstrap/cmd/compile/internal/mips64
bootstrap/cmd/compile/internal/ppc64
bootstrap/cmd/compile/internal/s390x
bootstrap/cmd/compile/internal/x86
bootstrap/cmd/compile
##### Building go_bootstrap for host, windows/amd64.
runtime/internal/sys
runtime/internal/atomic
runtime
unicode/utf8
math
unicode/utf16
internal/syscall/windows/sysdll
internal/race
unicode
errors
encoding
sync/atomic
math/bits
sync
internal/singleflight
syscall
io
cmd/go/internal/web
hash
bytes
strings
hash/adler32
strconv
bufio
internal/syscall/windows
path
internal/syscall/windows/registry
crypto
reflect
encoding/base64
time
crypto/sha1
internal/poll
encoding/binary
sort
os
regexp/syntax
container/heap
path/filepath
os/signal
fmt
regexp
io/ioutil
debug/dwarf
net/url
encoding/json
text/template/parse
compress/flate
cmd/go/internal/str
context
flag
go/token
encoding/xml
log
os/exec
go/scanner
compress/zlib
text/template
go/ast
debug/macho
debug/elf
go/doc
go/parser
go/build
cmd/go/internal/cfg
cmd/go/internal/buildid
cmd/go/internal/base
cmd/go/internal/cmdflag
cmd/go/internal/doc
cmd/go/internal/help
cmd/go/internal/load
cmd/go/internal/tool
cmd/go/internal/version
cmd/go/internal/work
cmd/go/internal/fmtcmd
cmd/go/internal/fix
cmd/go/internal/list
cmd/go/internal/get
cmd/go/internal/run
cmd/go/internal/clean
cmd/go/internal/envcmd
cmd/go/internal/generate
cmd/go/internal/test
cmd/go/internal/vet
cmd/go/internal/bug
cmd/go
1 file(s) moved.
##### Building packages and commands for windows/amd64.
runtime/internal/sys
runtime/internal/atomic
runtime
errors
internal/race
sync/atomic
unicode
sync
io
unicode/utf8
math
bytes
bufio
internal/syscall/windows/sysdll
unicode/utf16
syscall
strconv
internal/syscall/windows/registry
time
internal/syscall/windows
reflect
internal/poll
os
strings
fmt
sort
log
flag
path/filepath
cmd/internal/src
cmd/internal/objabi
encoding/binary
cmd/internal/goobj
cmd/internal/sys
container/list
path
debug/dwarf
math/bits
compress/flate
hash
debug/gosym
hash/adler32
compress/zlib
debug/elf
debug/macho
debug/pe
debug/plan9obj
cmd/vendor/golang.org/x/arch/arm/armasm
cmd/vendor/golang.org/x/arch/ppc64/ppc64asm
cmd/vendor/golang.org/x/arch/x86/x86asm
io/ioutil
regexp/syntax
text/tabwriter
regexp
archive/tar
hash/crc32
cmd/internal/objfile
archive/zip
cmd/addr2line
compress/bzip2
compress/gzip
compress/lzw
container/heap
container/ring
context
crypto
crypto/subtle
crypto/internal/cipherhw
crypto/cipher
math/rand
crypto/aes
crypto/des
math/big
crypto/sha512
crypto/hmac
crypto/md5
crypto/rc4
crypto/sha1
crypto/sha256
crypto/dsa
crypto/elliptic
encoding/asn1
crypto/rand
crypto/ecdsa
crypto/rsa
crypto/x509/pkix
encoding/hex
encoding/base64
internal/nettrace
internal/singleflight
encoding/pem
net
vendor/golang_org/x/crypto/chacha20poly1305/internal/chacha20
vendor/golang_org/x/crypto/poly1305
vendor/golang_org/x/crypto/chacha20poly1305
vendor/golang_org/x/crypto/curve25519
database/sql/driver
database/sql
crypto/x509
encoding
encoding/ascii85
encoding/base32
encoding/csv
crypto/tls
encoding/gob
encoding/json
encoding/xml
vendor/golang_org/x/net/http2/hpack
vendor/golang_org/x/text/transform
vendor/golang_org/x/text/unicode/bidi
vendor/golang_org/x/text/unicode/norm
vendor/golang_org/x/text/secure/bidirule
net/url
vendor/golang_org/x/net/idna
vendor/golang_org/x/net/proxy
mime
vendor/golang_org/x/net/lex/httplex
mime/quotedprintable
net/textproto
net/http/httptrace
mime/multipart
net/http/internal
go/token
net/http
go/scanner
go/ast
text/template/parse
text/template
go/doc
expvar
go/parser
go/constant
go/build
go/printer
go/types
go/format
os/exec
text/scanner
hash/crc64
hash/fnv
html
html/template
go/internal/gccgoimporter
go/internal/gcimporter
go/internal/srcimporter
image/color
image
go/importer
image/color/palette
index/suffixarray
runtime/debug
image/internal/imageutil
image/draw
image/jpeg
image/gif
image/png
runtime/trace
testing
internal/trace
internal/testenv
log/syslog
math/cmplx
net/http/cgi
net/http/cookiejar
net/http/fcgi
net/http/httptest
net/http/httputil
runtime/pprof
net/internal/socktest
net/http/pprof
net/mail
net/rpc
net/smtp
os/signal
net/rpc/jsonrpc
os/user
plugin
runtime/pprof/internal/profile
runtime/race
testing/internal/testdeps
testing/iotest
testing/quick
vendor/golang_org/x/text/secure
vendor/golang_org/x/text/unicode
cmd/api
cmd/internal/dwarf
cmd/internal/obj
cmd/internal/obj/arm
cmd/internal/obj/arm64
cmd/internal/obj/mips
cmd/internal/obj/ppc64
cmd/internal/obj/s390x
cmd/internal/obj/x86
cmd/asm/internal/flags
cmd/asm/internal/lex
cmd/internal/bio
cmd/asm/internal/arch
cmd/cgo
cmd/asm/internal/asm
cmd/asm
cmd/compile/internal/ssa
cmd/compile/internal/syntax
cmd/internal/gcprog
cmd/compile/internal/test
cmd/internal/browser
cmd/cover
cmd/dist
cmd/doc
cmd/fix
cmd/go/internal/cfg
cmd/go/internal/str
cmd/go/internal/base
cmd/go/internal/buildid
cmd/go/internal/load
cmd/go/internal/work
cmd/go/internal/envcmd
cmd/go/internal/web
cmd/go/internal/bug
cmd/go/internal/clean
cmd/go/internal/doc
cmd/go/internal/fix
cmd/go/internal/fmtcmd
cmd/go/internal/generate
cmd/go/internal/get
cmd/go/internal/help
cmd/go/internal/list
cmd/compile/internal/types
cmd/go/internal/run
cmd/go/internal/cmdflag
cmd/compile/internal/gc
cmd/go/internal/test
cmd/go/internal/tool
cmd/go/internal/version
cmd/go/internal/vet
cmd/go
cmd/gofmt
cmd/link/internal/ld
cmd/link/internal/amd64
cmd/link/internal/arm
cmd/link/internal/arm64
cmd/link/internal/mips
cmd/link/internal/mips64
cmd/compile/internal/amd64
cmd/compile/internal/arm
cmd/compile/internal/arm64
cmd/compile/internal/mips
cmd/compile/internal/mips64
cmd/compile/internal/ppc64
cmd/compile/internal/s390x
cmd/compile/internal/x86
cmd/link/internal/ppc64
cmd/compile
cmd/link/internal/s390x
cmd/link/internal/x86
cmd/link
cmd/nm
cmd/objdump
cmd/pack
cmd/vendor/github.com/google/pprof/internal/elfexec
cmd/vendor/github.com/google/pprof/profile
cmd/vendor/github.com/ianlancetaylor/demangle
cmd/vendor/github.com/google/pprof/internal/plugin
cmd/vendor/github.com/google/pprof/internal/measurement
cmd/vendor/github.com/google/pprof/internal/graph
cmd/vendor/github.com/google/pprof/internal/binutils
cmd/vendor/github.com/google/pprof/internal/report
cmd/vendor/github.com/google/pprof/internal/symbolz
cmd/vendor/github.com/google/pprof/internal/symbolizer
cmd/vendor/github.com/google/pprof/third_party/svg
cmd/trace
cmd/vendor/github.com/google/pprof/internal/driver
cmd/vendor/github.com/google/pprof/driver
cmd/pprof
cmd/vendor/github.com/google/pprof/internal/proftest
cmd/vet/internal/cfg
cmd/vet/internal/whitelist
cmd/vet
##### Testing packages.
ok archive/tar 0.515s
ok archive/zip 0.853s
ok bufio 0.067s
ok bytes 0.455s
ok compress/bzip2 0.064s
ok compress/flate 0.599s
ok compress/gzip 0.027s
ok compress/lzw 0.023s
ok compress/zlib 0.034s
ok container/heap 0.022s
ok container/list 0.023s
ok container/ring 0.039s
ok context 1.001s
ok crypto/aes 0.040s
ok crypto/cipher 0.026s
ok crypto/des 0.023s
ok crypto/dsa 0.021s
ok crypto/ecdsa 0.068s
ok crypto/elliptic 0.039s
ok crypto/hmac 0.022s
ok crypto/md5 0.037s
ok crypto/rand 0.027s
ok crypto/rc4 0.074s
ok crypto/rsa 0.067s
ok crypto/sha1 0.023s
ok crypto/sha256 0.021s
ok crypto/sha512 0.029s
ok crypto/subtle 0.031s
ok crypto/tls 0.418s
ok crypto/x509 1.505s
ok database/sql 0.455s
ok database/sql/driver 0.021s
ok debug/dwarf 0.036s
ok debug/elf 0.062s
ok debug/gosym 0.230s
ok debug/macho 0.043s
ok debug/pe 0.551s
ok debug/plan9obj 0.031s
ok encoding/ascii85 0.020s
ok encoding/asn1 0.026s
ok encoding/base32 0.020s
ok encoding/base64 0.020s
ok encoding/binary 0.022s
ok encoding/csv 0.018s
ok encoding/gob 0.041s
ok encoding/hex 0.027s
ok encoding/json 0.368s
ok encoding/pem 0.025s
ok encoding/xml 0.033s
ok errors 0.023s
ok expvar 0.033s
ok flag 0.021s
ok fmt 0.116s
ok go/ast 0.042s
ok go/build 0.705s
ok go/constant 0.055s
ok go/doc 0.147s
ok go/format 0.022s
ok go/internal/gccgoimporter 0.060s
ok go/internal/gcimporter 0.183s
ok go/internal/srcimporter 1.003s
ok go/parser 0.049s
ok go/printer 0.280s
ok go/scanner 0.024s
ok go/token 0.041s
ok go/types 0.632s
ok hash/adler32 0.028s
ok hash/crc32 0.044s
ok hash/crc64 0.032s
ok hash/fnv 0.021s
ok html 0.021s
ok html/template 0.044s
ok image 0.123s
ok image/color 0.027s
ok image/draw 0.057s
ok image/gif 0.065s
ok image/jpeg 0.210s
ok image/png 0.058s
ok index/suffixarray 0.024s
ok internal/poll 0.025s
ok internal/singleflight 0.032s
ok internal/syscall/windows/registry 0.036s
ok internal/trace 0.473s
ok io 0.052s
ok io/ioutil 0.021s
ok log 0.021s
ok math 0.020s
ok math/big 1.207s
ok math/bits 0.019s
ok math/cmplx 0.017s
ok math/rand 0.057s
ok mime 0.188s
ok mime/multipart 0.184s
ok mime/quotedprintable 0.200s
ok net 23.689s
ok net/http 11.051s
ok net/http/cgi 0.473s
ok net/http/cookiejar 0.383s
ok net/http/fcgi 0.222s
ok net/http/httptest 1.216s
ok net/http/httptrace 0.025s
ok net/http/httputil 0.061s
ok net/http/internal 0.019s
ok net/internal/socktest 0.020s
ok net/mail 0.025s
ok net/rpc 0.041s
ok net/rpc/jsonrpc 0.033s
ok net/smtp 0.036s
ok net/textproto 0.021s
ok net/url 0.020s
--- FAIL: TestNetworkSymbolicLink (0.01s)
os_windows_test.go:482: The Server service is not started.
FAIL
FAIL os 1.357s
ok os/exec 2.047s
--- FAIL: TestCtrlBreak (3.29s)
signal_windows_test.go:30: GenerateConsoleCtrlEvent: Incorrect function.
signal_windows_test.go:102: Program exited with error: exit status 1
2017/04/28 11:55:39 Timeout waiting for Ctrl+Break
FAIL
FAIL os/signal 3.310s
ok os/user 0.067s
ok path 0.021s
ok path/filepath 0.572s
ok reflect 0.103s
ok regexp 0.077s
ok regexp/syntax 0.265s
--- FAIL: TestEnumWindows (0.00s)
syscall_windows_test.go:152: USER32.EnumWindows returns FALSE
syscall_windows_test.go:155: Callback has been never called or your have no windows
--- FAIL: TestCallback (0.00s)
syscall_windows_test.go:176: nestedCall did not call func
--- FAIL: TestCallbackPanicLocked (0.00s)
syscall_windows_test.go:197: wrong panic: nestedCall returned
--- FAIL: TestCallbackPanic (0.00s)
syscall_windows_test.go:218: wrong panic: nestedCall returned
--- FAIL: TestCallbackPanicLoop (0.00s)
syscall_windows_test.go:218: wrong panic: nestedCall returned
FAIL
FAIL runtime 25.212s
ok runtime/debug 0.022s
ok runtime/internal/atomic 0.078s
ok runtime/internal/sys 0.018s
ok runtime/pprof 10.460s
ok runtime/pprof/internal/profile 0.019s
ok runtime/trace 13.428s
ok sort 0.062s
ok strconv 0.384s
ok strings 0.224s
ok sync 0.345s
ok sync/atomic 0.038s
ok syscall 0.021s
ok testing 1.576s
ok testing/quick 0.082s
ok text/scanner 0.023s
ok text/tabwriter 0.020s
ok text/template 0.538s
ok text/template/parse 0.028s
ok time 2.775s
ok unicode 0.026s
ok unicode/utf16 0.019s
ok unicode/utf8 0.021s
ok vendor/golang_org/x/crypto/chacha20poly1305 0.042s
ok vendor/golang_org/x/crypto/chacha20poly1305/internal/chacha20 0.019s
ok vendor/golang_org/x/crypto/curve25519 0.029s
ok vendor/golang_org/x/crypto/poly1305 0.017s
ok vendor/golang_org/x/net/http2/hpack 0.022s
ok vendor/golang_org/x/net/idna 0.020s
ok vendor/golang_org/x/net/lex/httplex 0.019s
ok vendor/golang_org/x/net/proxy 0.024s
ok vendor/golang_org/x/text/transform 0.031s
ok vendor/golang_org/x/text/unicode/norm 0.020s
ok cmd/addr2line 2.469s
ok cmd/api 0.035s
ok cmd/asm/internal/asm 0.113s
ok cmd/asm/internal/lex 0.020s
ok cmd/compile 5.179s
ok cmd/compile/internal/gc 11.484s
ok cmd/compile/internal/ssa 0.247s
ok cmd/compile/internal/syntax 0.031s
ok cmd/compile/internal/test 0.037s [no tests to run]
ok cmd/compile/internal/types 0.032s
ok cmd/cover 1.361s
ok cmd/doc 0.052s
ok cmd/fix 0.037s
ok cmd/go 54.278s
ok cmd/go/internal/generate 0.030s
ok cmd/go/internal/get 0.034s
ok cmd/go/internal/load 0.029s
ok cmd/go/internal/work 0.095s
ok cmd/gofmt 0.079s
ok cmd/internal/dwarf 0.018s
ok cmd/internal/obj 0.018s
ok cmd/internal/obj/arm64 0.020s
ok cmd/internal/obj/x86 0.314s
ok cmd/internal/objabi 0.021s
ok cmd/internal/src 0.023s
ok cmd/link 0.019s
ok cmd/link/internal/ld 0.561s
ok cmd/nm 1.073s
ok cmd/objdump 1.310s
ok cmd/pack 1.440s
ok cmd/trace 0.027s
ok cmd/vendor/github.com/google/pprof/internal/binutils 0.022s
ok cmd/vendor/github.com/google/pprof/internal/driver 1.115s
ok cmd/vendor/github.com/google/pprof/internal/elfexec 0.018s
ok cmd/vendor/github.com/google/pprof/internal/graph 0.022s
ok cmd/vendor/github.com/google/pprof/internal/report 0.027s
ok cmd/vendor/github.com/google/pprof/internal/symbolizer 0.040s
ok cmd/vendor/github.com/google/pprof/internal/symbolz 0.022s
ok cmd/vendor/github.com/google/pprof/profile 0.073s
ok cmd/vendor/github.com/ianlancetaylor/demangle 0.028s
ok cmd/vendor/golang.org/x/arch/arm/armasm 0.022s
ok cmd/vendor/golang.org/x/arch/ppc64/ppc64asm 0.020s
ok cmd/vendor/golang.org/x/arch/x86/x86asm 0.116s
ok cmd/vet 0.022s
ok cmd/vet/internal/cfg 0.019s
2017/04/28 11:57:38 Failed: exit status 1
---> 929238cbd811
Removing intermediate container 8123dd479ecc
Successfully built 929238cbd811
Successfully tagged golang-builder:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment