mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-27 22:06:24 +02:00
parent
b6e5e700cf
commit
a6f541de1b
2 changed files with 7 additions and 11 deletions
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
|
|
@ -49,6 +49,7 @@ jobs:
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
|
||||||
# Sign the Docker image
|
# Sign the Docker image
|
||||||
- name: Install cosign
|
- name: Install cosign
|
||||||
|
|
|
||||||
17
Dockerfile
17
Dockerfile
|
|
@ -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>"
|
LABEL maintainer="Will Norris <will@willnorris.com>"
|
||||||
|
|
||||||
RUN useradd -u 1001 go
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
COPY . .
|
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
|
COPY --from=build /app/imageproxy /app/imageproxy
|
||||||
|
|
||||||
USER go
|
|
||||||
|
|
||||||
CMD ["-addr", "0.0.0.0:8080"]
|
CMD ["-addr", "0.0.0.0:8080"]
|
||||||
ENTRYPOINT ["/app/imageproxy"]
|
ENTRYPOINT ["/app/imageproxy"]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue