mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 11:05:45 +00:00
build_docker.sh, Dockerfile: fix bug with shell quoting
Fixes #1449 Signed-off-by: Steve Coffman <steve@khanacademy.org>
This commit is contained in:
parent
602f92ec30
commit
0d0fad43ed
14
Dockerfile
14
Dockerfile
@ -49,10 +49,18 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# see build_docker.sh
|
# see build_docker.sh
|
||||||
ARG goflags_arg=""
|
ARG VERSION_LONG=""
|
||||||
ENV GOFLAGS=$goflags_arg
|
ENV VERSION_LONG=$VERSION_LONG
|
||||||
|
ARG VERSION_SHORT=""
|
||||||
|
ENV VERSION_SHORT=$VERSION_SHORT
|
||||||
|
ARG VERSION_GIT_HASH=""
|
||||||
|
ENV VERSION_GIT_HASH=$VERSION_GIT_HASH
|
||||||
|
|
||||||
RUN go install -v ./cmd/...
|
RUN go install -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" \
|
||||||
|
-v ./cmd/...
|
||||||
|
|
||||||
FROM alpine:3.11
|
FROM alpine:3.11
|
||||||
RUN apk add --no-cache ca-certificates iptables iproute2
|
RUN apk add --no-cache ca-certificates iptables iproute2
|
||||||
|
@ -27,5 +27,8 @@ set -eu
|
|||||||
|
|
||||||
eval $(./version/version.sh)
|
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 \
|
||||||
docker build --build-arg goflags_arg="'""${GOFLAGS}""'" -t tailscale:tailscale .
|
--build-arg VERSION_LONG=$VERSION_LONG \
|
||||||
|
--build-arg VERSION_SHORT=$VERSION_SHORT \
|
||||||
|
--build-arg VERSION_GIT_HASH=$VERSION_GIT_HASH \
|
||||||
|
-t tailscale:tailscale .
|
||||||
|
Loading…
Reference in New Issue
Block a user