dynbinary 775 B

1234567891011121314151617
  1. #!/bin/bash
  2. DEST=$1
  3. # dockerinit still needs to be a static binary, even if docker is dynamic
  4. CGO_ENABLED=0 go build -o $DEST/dockerinit-$VERSION -ldflags "$LDFLAGS -d" $BUILDFLAGS ./dockerinit
  5. echo "Created binary: $DEST/dockerinit-$VERSION"
  6. ln -sf dockerinit-$VERSION $DEST/dockerinit
  7. # sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another
  8. export DOCKER_INITSHA1="$(sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)"
  9. # exported so that "dyntest" can easily access it later without recalculating it
  10. (
  11. export LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\" -X github.com/dotcloud/docker/utils.INITPATH \"$DOCKER_INITPATH\""
  12. source "$(dirname "$BASH_SOURCE")/binary"
  13. )