universal: cloudflared mod initial release

This commit is contained in:
Spunkie
2021-05-16 05:23:49 -06:00
parent 4332ca4f90
commit c4dc8bfe61
5 changed files with 295 additions and 48 deletions
+28
View File
@@ -1,6 +1,34 @@
# Build container
FROM golang:alpine AS buildstage
RUN mkdir /cloudflared
WORKDIR /src
RUN apk --no-cache add git build-base curl jq
ENV GO111MODULE=on \
CGO_ENABLED=0
RUN curl -s https://api.github.com/repos/cloudflare/cloudflared/releases/latest \
| jq -rc ".tag_name" \
| xargs -I TAG sh -c 'git -c advice.detachedHead=false clone https://github.com/cloudflare/cloudflared --depth=1 --branch TAG .'
RUN GOOS=linux GOARCH=amd64 make cloudflared
RUN mv cloudflared /cloudflared/cloudflared-amd64
RUN GOOS=linux GOARCH=arm64 make cloudflared
RUN mv cloudflared /cloudflared/cloudflared-arm64
RUN GOOS=linux GOARCH=arm make cloudflared
RUN mv cloudflared /cloudflared/cloudflared-armhf
# Runtime container
FROM scratch
WORKDIR /
LABEL maintainer="Spunkie"
# copy cloudflared bins
COPY --from=buildstage /cloudflared /cloudflared
# copy local files
COPY root/ /