github.com/shiroyuki/docker@v1.9.0/hack/make/.dockerinit (about) 1 #!/bin/bash 2 set -e 3 4 IAMSTATIC="true" 5 source "${MAKEDIR}/.go-autogen" 6 7 # dockerinit still needs to be a static binary, even if docker is dynamic 8 go build \ 9 -o "$DEST/dockerinit-$VERSION" \ 10 "${BUILDFLAGS[@]}" \ 11 -ldflags " 12 $LDFLAGS 13 $LDFLAGS_STATIC 14 -extldflags \"$EXTLDFLAGS_STATIC\" 15 " \ 16 ./dockerinit 17 18 echo "Created binary: $DEST/dockerinit-$VERSION" 19 ln -sf "dockerinit-$VERSION" "$DEST/dockerinit" 20 21 sha1sum= 22 if command -v sha1sum &> /dev/null; then 23 sha1sum=sha1sum 24 elif command -v shasum &> /dev/null; then 25 # Mac OS X - why couldn't they just use the same command name and be happy? 26 sha1sum=shasum 27 else 28 echo >&2 'error: cannot find sha1sum command or equivalent' 29 exit 1 30 fi 31 32 # sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another 33 export DOCKER_INITSHA1=$($sha1sum "$DEST/dockerinit-$VERSION" | cut -d' ' -f1)