From b6e5e700cf6e00049aee6bce66824171561a8a81 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Mon, 14 Nov 2022 11:20:07 -0800 Subject: [PATCH] Revert "docker: add multi-platform support" Didn't mean to push this yet. This reverts commit 43b75b0ba24e6ef1ade94ef26cd541d67e16db3a. --- .github/workflows/docker.yml | 4 ---- Dockerfile | 17 +++++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 72feef1..469d254 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -49,10 +49,6 @@ 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 diff --git a/Dockerfile b/Dockerfile index ac07ff6..b40ae84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,26 @@ -# syntax=docker/dockerfile:1.4 -FROM --platform=$BUILDPLATFORM cgr.dev/chainguard/go:latest as build +FROM golang:1.17 as build LABEL maintainer="Will Norris " +RUN useradd -u 1001 go + WORKDIR /app + COPY go.mod go.sum ./ RUN go mod download COPY . . -ARG TARGETOS -ARG TARGETARCH -RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -v ./cmd/imageproxy +RUN CGO_ENABLED=0 GOOS=linux go build -v ./cmd/imageproxy -FROM cgr.dev/chainguard/static:latest +FROM scratch +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"]