github.com/shiroyuki/docker@v1.9.0/hack/make/.go-autogen (about) 1 #!/bin/bash 2 3 rm -rf autogen 4 5 mkdir -p autogen/dockerversion 6 cat > autogen/dockerversion/dockerversion.go <<DVEOF 7 // AUTOGENERATED FILE; see $BASH_SOURCE 8 package dockerversion 9 10 var ( 11 GITCOMMIT string = "$GITCOMMIT" 12 VERSION string = "$VERSION" 13 BUILDTIME string = "$BUILDTIME" 14 15 IAMSTATIC string = "${IAMSTATIC:-true}" 16 INITSHA1 string = "$DOCKER_INITSHA1" 17 INITPATH string = "$DOCKER_INITPATH" 18 ) 19 DVEOF 20 21 # Compile the Windows resources into the sources 22 mkdir -p autogen/winresources 23 cat > autogen/winresources/resources.go <<WREOF 24 // AUTOGENERATED FILE; see $BASH_SOURCE 25 package winresources 26 27 /* 28 29 This package is for embedding a manifest file and an icon into docker.exe. 30 The benefit of this is that a manifest file does not need to be alongside 31 the .exe, and there is an icon when docker runs, or viewed through Windows 32 explorer. 33 34 When make binary is run, the Dockerfile prepares the build environment by: 35 36 - Cloning github.com/akavel/rsrc 37 38 - Go-installing the rsrc executable 39 40 make.sh invokes hack/make/.go-autogen to: 41 42 - Run rsrc to create a binary file (autogen/winresources/rsrc.syso) that 43 contains the manifest and icon. This file is automatically picked up by 44 'go build', so no post-processing steps are required. The sources for 45 rsrc.syso are under hack/make/.resources-windows. 46 47 */ 48 WREOF 49 if [ "$(go env GOOS)" = 'windows' ]; then 50 rsrc \ 51 -manifest hack/make/.resources-windows/docker.exe.manifest \ 52 -ico hack/make/.resources-windows/docker.ico \ 53 -o autogen/winresources/rsrc.syso > /dev/null 54 fi