-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
27 lines (22 loc) · 838 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM golang:1.16.7-alpine3.14 as builder
WORKDIR /app
COPY . ./
# This is where one could build the application code as well.
# Using https://tailscale.com/kb/1132/flydotio as a reference
FROM alpine:latest as tailscale
WORKDIR /app
COPY . ./
ENV TSFILE=tailscale_1.32.3_amd64.tgz
RUN wget https://pkgs.tailscale.com/stable/${TSFILE} && \
tar xzf ${TSFILE} --strip-components=1
COPY . ./
FROM alpine:latest
RUN apk update && apk add ca-certificates iptables iproute2 && rm -rf /var/cache/apk/*
# Copy binary to production image
COPY --from=builder /app/start.sh /start.sh
COPY --from=tailscale /app/tailscaled /usr/bin/tailscaled
COPY --from=tailscale /app/tailscale /usr/bin/tailscale
RUN chmod -R 754 /start.sh
RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale
# Run on container startup.
CMD ["/start.sh"]