diff --git a/build_docker.sh b/build_docker.sh index 43665172a..272f228f8 100755 --- a/build_docker.sh +++ b/build_docker.sh @@ -49,7 +49,7 @@ case "$TARGET" in -X tailscale.com/version.gitCommitStamp=${VERSION_GIT_HASH}" \ --base="${BASE}" \ --tags="${TAGS}" \ - --gotags="ts_kube" \ + --gotags="ts_kube,ts_package_container" \ --repos="${REPOS}" \ --push="${PUSH}" \ --target="${PLATFORM}" \ diff --git a/hostinfo/hostinfo_linux.go b/hostinfo/hostinfo_linux.go index d194fbb0d..53d4187bc 100644 --- a/hostinfo/hostinfo_linux.go +++ b/hostinfo/hostinfo_linux.go @@ -159,7 +159,14 @@ func linuxVersionMeta() (meta versionMeta) { return } +// linuxBuildTagPackageType is set by packagetype_*.go +// build tag guarded files. +var linuxBuildTagPackageType string + func packageTypeLinux() string { + if v := linuxBuildTagPackageType; v != "" { + return v + } // Report whether this is in a snap. // See https://snapcraft.io/docs/environment-variables // We just look at two somewhat arbitrarily. diff --git a/hostinfo/packagetype_container.go b/hostinfo/packagetype_container.go new file mode 100644 index 000000000..9bd14493c --- /dev/null +++ b/hostinfo/packagetype_container.go @@ -0,0 +1,10 @@ +// Copyright (c) Tailscale Inc & AUTHORS +// SPDX-License-Identifier: BSD-3-Clause + +//go:build linux && ts_package_container + +package hostinfo + +func init() { + linuxBuildTagPackageType = "container" +}