2021-01-20 16:55:05 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# Runs `go build` with flags configured for docker distribution. All
|
|
|
|
# it does differently from `go build` is burn git commit and version
|
|
|
|
# information into the binaries inside docker, so that we can track down user
|
|
|
|
# issues.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
#
|
2021-10-12 20:27:39 +01:00
|
|
|
# WARNING: Tailscale is not yet officially supported in container
|
|
|
|
# environments, such as Docker and Kubernetes. Though it should work, we
|
|
|
|
# don't regularly test it, and we know there are some feature limitations.
|
2021-01-20 16:55:05 +00:00
|
|
|
#
|
2021-10-12 20:27:39 +01:00
|
|
|
# See current bugs tagged "containers":
|
2021-01-20 16:55:05 +00:00
|
|
|
# https://github.com/tailscale/tailscale/labels/containers
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
2022-01-04 00:53:36 +00:00
|
|
|
# Use the "go" binary from the "tool" directory (which is github.com/tailscale/go)
|
|
|
|
export PATH=$PWD/tool:$PATH
|
|
|
|
|
2021-07-07 07:25:39 +01:00
|
|
|
eval $(./build_dist.sh shellvars)
|
2022-01-03 18:09:00 +00:00
|
|
|
DEFAULT_TAGS="v${VERSION_SHORT},v${VERSION_MINOR}"
|
|
|
|
DEFAULT_REPOS="tailscale/tailscale,ghcr.io/tailscale/tailscale"
|
|
|
|
DEFAULT_BASE="ghcr.io/tailscale/alpine-base:3.14"
|
|
|
|
|
|
|
|
PUSH="${PUSH:-false}"
|
|
|
|
REPOS="${REPOS:-${DEFAULT_REPOS}}"
|
|
|
|
TAGS="${TAGS:-${DEFAULT_TAGS}}"
|
|
|
|
BASE="${BASE:-${DEFAULT_BASE}}"
|
2021-01-20 16:55:05 +00:00
|
|
|
|
2021-11-22 04:52:19 +00:00
|
|
|
go run github.com/tailscale/mkctr@latest \
|
|
|
|
--gopaths="\
|
|
|
|
tailscale.com/cmd/tailscale:/usr/local/bin/tailscale, \
|
|
|
|
tailscale.com/cmd/tailscaled:/usr/local/bin/tailscaled" \
|
|
|
|
--ldflags="\
|
|
|
|
-X tailscale.com/version.Long=${VERSION_LONG} \
|
|
|
|
-X tailscale.com/version.Short=${VERSION_SHORT} \
|
|
|
|
-X tailscale.com/version.GitCommit=${VERSION_GIT_HASH}" \
|
2022-01-03 18:09:00 +00:00
|
|
|
--base="${BASE}" \
|
|
|
|
--tags="${TAGS}" \
|
|
|
|
--repos="${REPOS}" \
|
|
|
|
--push="${PUSH}"
|