|
2 | 2 |
|
3 | 3 | DEST=$1 |
4 | 4 |
|
5 | | -# dockerinit still needs to be a static binary, even if docker is dynamic |
6 | | -go build \ |
7 | | - -o $DEST/dockerinit-$VERSION \ |
8 | | - "${BUILDFLAGS[@]}" \ |
9 | | - -ldflags " |
10 | | - $LDFLAGS |
11 | | - $LDFLAGS_STATIC |
12 | | - -extldflags \"$EXTLDFLAGS_STATIC\" |
13 | | - " \ |
14 | | - ./dockerinit |
15 | | -echo "Created binary: $DEST/dockerinit-$VERSION" |
16 | | -ln -sf dockerinit-$VERSION $DEST/dockerinit |
17 | | - |
18 | | -sha1sum= |
19 | | -if command -v sha1sum &> /dev/null; then |
20 | | - sha1sum=sha1sum |
21 | | -elif command -v shasum &> /dev/null; then |
22 | | - # Mac OS X - why couldn't they just use the same command name and be happy? |
23 | | - sha1sum=shasum |
| 5 | +if [ -z "$DOCKER_CLIENTONLY" ]; then |
| 6 | + # dockerinit still needs to be a static binary, even if docker is dynamic |
| 7 | + go build \ |
| 8 | + -o $DEST/dockerinit-$VERSION \ |
| 9 | + "${BUILDFLAGS[@]}" \ |
| 10 | + -ldflags " |
| 11 | + $LDFLAGS |
| 12 | + $LDFLAGS_STATIC |
| 13 | + -extldflags \"$EXTLDFLAGS_STATIC\" |
| 14 | + " \ |
| 15 | + ./dockerinit |
| 16 | + echo "Created binary: $DEST/dockerinit-$VERSION" |
| 17 | + ln -sf dockerinit-$VERSION $DEST/dockerinit |
| 18 | + |
| 19 | + sha1sum= |
| 20 | + if command -v sha1sum &> /dev/null; then |
| 21 | + sha1sum=sha1sum |
| 22 | + elif command -v shasum &> /dev/null; then |
| 23 | + # Mac OS X - why couldn't they just use the same command name and be happy? |
| 24 | + sha1sum=shasum |
| 25 | + else |
| 26 | + echo >&2 'error: cannot find sha1sum command or equivalent' |
| 27 | + exit 1 |
| 28 | + fi |
| 29 | + |
| 30 | + # sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another |
| 31 | + export DOCKER_INITSHA1="$($sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)" |
24 | 32 | else |
25 | | - echo >&2 'error: cannot find sha1sum command or equivalent' |
26 | | - exit 1 |
| 33 | + # DOCKER_CLIENTONLY must be truthy, so we don't need to bother with dockerinit :) |
| 34 | + export DOCKER_INITSHA1="" |
27 | 35 | fi |
28 | | - |
29 | | -# sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another |
30 | | -export DOCKER_INITSHA1="$($sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)" |
31 | 36 | # exported so that "dyntest" can easily access it later without recalculating it |
32 | 37 |
|
33 | 38 | ( |
|
0 commit comments