-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use alpine for architectures that distroless doesn't support
- Loading branch information
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ env: | |
# github.repository as <account>/<repo> | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
|
||
jobs: | ||
build: | ||
strategy: | ||
|
@@ -28,18 +27,23 @@ jobs: | |
platform: | ||
- docker: linux/amd64 | ||
go: amd64 | ||
dockerfile: Dockerfile | ||
- docker: linux/arm/v6 | ||
go: arm | ||
qemu: arm | ||
dockerfile: alpine.Dockerfile | ||
- docker: linux/arm/v7 | ||
go: arm | ||
qemu: arm | ||
dockerfile: Dockerfile | ||
- docker: linux/arm64 | ||
go: arm64 | ||
qemu: arm64 | ||
dockerfile: Dockerfile | ||
- docker: linux/riscv64 | ||
go: riscv64 | ||
qemu: riscv64 | ||
dockerfile: alpine.Dockerfile | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
@@ -62,9 +66,9 @@ jobs: | |
# https://github.com/sigstore/cosign-installer | ||
- name: Install cosign | ||
if: github.event_name != 'pull_request' | ||
uses: sigstore/[email protected].1 | ||
uses: sigstore/[email protected].2 | ||
with: | ||
cosign-release: 'v2.1.1' | ||
cosign-release: 'v2.2.0' | ||
|
||
# Set up BuildKit Docker container builder to be able to build | ||
# multi-platform images and export cache | ||
|
@@ -103,6 +107,7 @@ jobs: | |
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ${{ matrix.platform.dockerfile }} | ||
build-args: GOARCH=${{ matrix.platform.go }} | ||
platforms: ${{ matrix.platform.docker }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM golang:1.21-alpine as server_build | ||
|
||
WORKDIR /appbuild | ||
|
||
ARG GOARCH | ||
|
||
# Add build deps | ||
RUN apk add --update gcc g++ git | ||
|
||
COPY go.mod go.sum /appbuild/ | ||
|
||
COPY ./ /appbuild | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -o fritzbox-cloudflare-dyndns | ||
|
||
# Build deployable server | ||
FROM alpine:3 | ||
|
||
ENV FRITZBOX_ENDPOINT_URL=${FRITZBOX_ENDPOINT_URL:-http://fritz.box:49000} \ | ||
FRITZBOX_ENDPOINT_TIMEOUT=${FRITZBOX_ENDPOINT_TIMEOUT:-30s} \ | ||
DYNDNS_SERVER_BIND=${DYNDNS_SERVER_BIND:-:8080} \ | ||
DYNDNS_SERVER_USERNAME=${DYNDNS_SERVER_USERNAME} \ | ||
DYNDNS_SERVER_PASSWORD=${DYNDNS_SERVER_PASSWORD} \ | ||
CLOUDFLARE_API_EMAIL="" \ | ||
CLOUDFLARE_API_KEY="" \ | ||
CLOUDFLARE_ZONES_IPV4="" \ | ||
CLOUDFLARE_ZONES_IPV6="" \ | ||
CLOUDFLARE_LOCAL_ADDRESS_IPV6="" | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=server_build /appbuild/fritzbox-cloudflare-dyndns /app/fritzbox-cloudflare-dyndns | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["./fritzbox-cloudflare-dyndns"] |