mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 11:41:39 +00:00
Add docker build script to inject version information
Signed-off-by: Steve Coffman <steve@khanacademy.org>
This commit is contained in:
parent
c55d26967b
commit
fec9490378
@ -48,6 +48,9 @@ RUN go mod download
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
ARG goflags_arg # default intentionally unset
|
||||||
|
ENV GOFLAGS=$goflags_arg
|
||||||
|
|
||||||
RUN go install -v ./cmd/...
|
RUN go install -v ./cmd/...
|
||||||
|
|
||||||
FROM alpine:3.11
|
FROM alpine:3.11
|
||||||
|
31
build_docker.sh
Executable file
31
build_docker.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/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.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# WARNING: Tailscale is not yet officially supported in Docker,
|
||||||
|
# Kubernetes, etc.
|
||||||
|
#
|
||||||
|
# It might work, but we don't regularly test it, and it's not as polished as
|
||||||
|
# our currently supported platforms. This is provided for people who know
|
||||||
|
# how Tailscale works and what they're doing.
|
||||||
|
#
|
||||||
|
# Our tracking bug for officially support container use cases is:
|
||||||
|
# https://github.com/tailscale/tailscale/issues/504
|
||||||
|
#
|
||||||
|
# Also, see the various bugs tagged "containers":
|
||||||
|
# https://github.com/tailscale/tailscale/labels/containers
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
eval $(./version/version.sh)
|
||||||
|
|
||||||
|
GOFLAGS='-tags xversion -ldflags '"-X tailscale.com/version.Long=${VERSION_LONG} -X tailscale.com/version.Short=${VERSION_SHORT} -X tailscale.com/version.GitCommit=${VERSION_GIT_HASH}"
|
||||||
|
docker build --build-arg goflags_arg="'""${GOFLAGS}""'" -t tailscale:tailscale .
|
Loading…
x
Reference in New Issue
Block a user