0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-16 21:56:43 -05:00

docker: add multi-platform support

This commit is contained in:
Will Norris 2022-11-14 11:18:09 -08:00
parent 0e35e587f2
commit 43b75b0ba2
2 changed files with 10 additions and 11 deletions

View file

@ -49,6 +49,10 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
# Sign the Docker image
- name: Install cosign

View file

@ -1,26 +1,21 @@
FROM golang:1.17 as build
# syntax=docker/dockerfile:1.4
FROM --platform=$BUILDPLATFORM cgr.dev/chainguard/go:latest as build
LABEL maintainer="Will Norris <will@willnorris.com>"
RUN useradd -u 1001 go
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -v ./cmd/imageproxy
ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -v ./cmd/imageproxy
FROM scratch
FROM cgr.dev/chainguard/static:latest
COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /app/imageproxy /app/imageproxy
USER go
CMD ["-addr", "0.0.0.0:8080"]
ENTRYPOINT ["/app/imageproxy"]