-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
29 lines (26 loc) · 849 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
28
29
FROM golang:1.17-alpine AS build-golang
RUN apk add --update \
git \
gcc \
libc-dev
ENV CGO_ENABLED=0
COPY . /go/src/tproxy
WORKDIR /go/src/tproxy
RUN go mod download
RUN go install .
FROM alpine:latest as build-tailscale
WORKDIR /bin
COPY . ./
ENV TSFILE=tailscale_1.14.3_amd64.tgz
RUN wget https://pkgs.tailscale.com/stable/${TSFILE} && \
tar xzf ${TSFILE} --strip-components=1
FROM alpine:latest AS tproxy
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
COPY entrypoint.sh /bin/entrypoint.sh
COPY --from=build-golang /go/bin/tproxy /bin/tproxy
COPY --from=build-tailscale /bin/tailscaled /bin/tailscaled
COPY --from=build-tailscale /bin/tailscale /bin/tailscale
RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale
LABEL Author="Michael Wilson"
ENTRYPOINT ["/bin/entrypoint.sh"]
EXPOSE 443