23 lines
699 B
Docker
23 lines
699 B
Docker
FROM golang:1.22-alpine AS builder
|
|
|
|
ARG TELEBIT_REF=master
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
WORKDIR /src
|
|
RUN git clone --depth 1 --branch "${TELEBIT_REF}" https://github.com/therootcompany/telebit.git .
|
|
|
|
RUN go generate -mod=vendor ./...
|
|
RUN CGO_ENABLED=0 go build -mod=vendor -ldflags="-s -w" -o /out/telebit-relay ./cmd/telebit
|
|
RUN CGO_ENABLED=0 go build -mod=vendor -ldflags="-s -w" -o /out/telebit-mgmt ./cmd/mgmt
|
|
|
|
FROM alpine:3.20
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
RUN printf '68f8f2b8d1c04e3d9343b0c84b69a3a1\n' > /etc/machine-id
|
|
|
|
COPY --from=builder /out/telebit-relay /usr/local/bin/telebit-relay
|
|
COPY --from=builder /out/telebit-mgmt /usr/local/bin/telebit-mgmt
|
|
|
|
WORKDIR /var/lib/telebit
|