Dockerfile 897 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
  2. # Use of this source code is governed by a BSD-style
  3. # license that can be found in the LICENSE file.
  4. # This Dockerfile includes all the tailscale binaries.
  5. #
  6. # To build the Dockerfile:
  7. #
  8. # $ docker build -t tailscale:tailscale .
  9. #
  10. # To run the tailscaled agent:
  11. #
  12. # $ docker run -d --name=tailscaled -v /var/lib:/var/lib -v /dev/net/tun:/dev/net/tun --network=host --privileged tailscale:tailscale tailscaled
  13. #
  14. # To then log in:
  15. #
  16. # $ docker exec tailscaled tailscale up
  17. #
  18. # To see status:
  19. #
  20. # $ docker exec tailscaled tailscale status
  21. FROM golang:1.15-alpine AS build-env
  22. WORKDIR /go/src/tailscale
  23. COPY go.mod .
  24. COPY go.sum .
  25. RUN go mod download
  26. COPY . .
  27. RUN go install -v ./cmd/...
  28. FROM alpine:3.11
  29. RUN apk add --no-cache ca-certificates iptables iproute2
  30. COPY --from=build-env /go/bin/* /usr/local/bin/