2020-02-11 01:50:05 +00:00
|
|
|
# Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
2021-01-12 03:23:43 +00:00
|
|
|
############################################################################
|
|
|
|
#
|
2021-10-12 19:27:39 +00: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-12 03:23:43 +00:00
|
|
|
#
|
2021-10-12 19:27:39 +00:00
|
|
|
# See current bugs tagged "containers":
|
2021-01-12 03:23:43 +00:00
|
|
|
# https://github.com/tailscale/tailscale/labels/containers
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-04-06 14:57:47 +00:00
|
|
|
# This Dockerfile includes all the tailscale binaries.
|
|
|
|
#
|
|
|
|
# To build the Dockerfile:
|
|
|
|
#
|
2021-10-16 07:43:25 +00:00
|
|
|
# $ docker build -t tailscale/tailscale .
|
2020-04-06 14:57:47 +00:00
|
|
|
#
|
|
|
|
# To run the tailscaled agent:
|
|
|
|
#
|
2021-10-16 07:43:25 +00:00
|
|
|
# $ docker run -d --name=tailscaled -v /var/lib:/var/lib -v /dev/net/tun:/dev/net/tun --network=host --privileged tailscale/tailscale tailscaled
|
2020-04-06 14:57:47 +00:00
|
|
|
#
|
|
|
|
# To then log in:
|
|
|
|
#
|
|
|
|
# $ docker exec tailscaled tailscale up
|
|
|
|
#
|
|
|
|
# To see status:
|
|
|
|
#
|
|
|
|
# $ docker exec tailscaled tailscale status
|
|
|
|
|
|
|
|
|
2021-09-02 19:28:03 +00:00
|
|
|
FROM golang:1.17-alpine AS build-env
|
2020-02-11 01:50:05 +00:00
|
|
|
|
|
|
|
WORKDIR /go/src/tailscale
|
2020-02-14 21:31:14 +00:00
|
|
|
|
2021-07-28 18:07:50 +00:00
|
|
|
COPY go.mod go.sum ./
|
2020-02-14 21:31:14 +00:00
|
|
|
RUN go mod download
|
|
|
|
|
2020-02-11 01:50:05 +00:00
|
|
|
COPY . .
|
|
|
|
|
2021-02-19 21:06:07 +00:00
|
|
|
# see build_docker.sh
|
2021-03-05 16:51:27 +00:00
|
|
|
ARG VERSION_LONG=""
|
|
|
|
ENV VERSION_LONG=$VERSION_LONG
|
|
|
|
ARG VERSION_SHORT=""
|
|
|
|
ENV VERSION_SHORT=$VERSION_SHORT
|
|
|
|
ARG VERSION_GIT_HASH=""
|
|
|
|
ENV VERSION_GIT_HASH=$VERSION_GIT_HASH
|
2021-01-20 16:55:05 +00:00
|
|
|
|
2021-03-05 16:51:27 +00:00
|
|
|
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" \
|
2021-10-13 18:33:11 +00:00
|
|
|
-v ./cmd/tailscale ./cmd/tailscaled
|
2020-02-11 01:50:05 +00:00
|
|
|
|
2021-08-15 03:53:56 +00:00
|
|
|
FROM alpine:3.14
|
2021-10-13 21:30:24 +00:00
|
|
|
RUN apk add --no-cache ca-certificates iptables iproute2 ip6tables
|
2020-02-14 21:31:14 +00:00
|
|
|
COPY --from=build-env /go/bin/* /usr/local/bin/
|