Skip to content

Commit

Permalink
Use alpine upstream because golang does not build riscv :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Knight1 committed Oct 18, 2024
1 parent 74e8994 commit d7d2ea0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ jobs:
linux/s390x
linux/386
linux/riscv64
linux/mips64
linux/mips64le
linux/mips
push: true
tags: |
knight/cloudflared-dns:latest
Expand Down
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
ARG GOLANG_VERSION=1.23.2
ARG ALPINE_VERSION=3.20
ARG UPSTREAM_RELEASE_TAG=2024.10.0

FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS gobuild
ARG GOLANG_VERSION
FROM alpine:${ALPINE_VERSION} AS gobuild
ARG ALPINE_VERSION
ARG UPSTREAM_RELEASE_TAG

WORKDIR /tmp

RUN apk add --no-cache gcc build-base curl tar && \
RUN apk add --no-cache gcc build-base curl tar go && \
mkdir release && \
curl -L "https://github.com/cloudflare/cloudflared/archive/refs/tags/${UPSTREAM_RELEASE_TAG}.tar.gz" | tar xvz --strip 1 -C ./release

WORKDIR /tmp/release/cmd/cloudflared

RUN go build -ldflags="-X 'main.Version=$UPSTREAM_RELEASE_TAG' -X 'main.BuildTime=$(date +%B\ %Y)'"
RUN go build -ldflags="-X 'main.Version=$UPSTREAM_RELEASE_TAG' -X 'main.BuildTime=$(date +%B\ %Y)' -s -w"

FROM alpine:${ALPINE_VERSION}

ARG GOLANG_VERSION
ARG ALPINE_VERSION

LABEL maintainer="Jan Collijs & Knight1"
LABEL org.opencontainers.image.source="https://github.com/Knight1/cloudflared"
LABEL org.opencontainers.image.source="https://github.com/knight1/cloudflared"

ENV UPSTREAM1=https://1.1.1.1/dns-query
ENV UPSTREAM2=https://1.0.0.1/dns-query
Expand Down

0 comments on commit d7d2ea0

Please sign in to comment.