Skip to content

Commit

Permalink
Merge pull request #16 from nirmata/alpine
Browse files Browse the repository at this point in the history
feat: change image to scratch
  • Loading branch information
realshuting committed Jul 14, 2023
2 parents 1cc230f + df8e2fc commit 5e4a3b6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILD_PLATFORM="linux/amd64"
ARG BUILDER_IMAGE="golang:1.19"
ARG BUILDER_IMAGE="golang:1.20.6-alpine3.18"

FROM --platform=$BUILD_PLATFORM $BUILDER_IMAGE as builder

Expand All @@ -10,17 +10,18 @@ COPY . ./
ARG SIGNER_BINARY_LINK="https://d2hvyiie56hcat.cloudfront.net/linux/amd64/plugin/latest/notation-aws-signer-plugin.zip"
ARG SIGNER_BINARY_FILE="notation-aws-signer-plugin.zip"
RUN wget -O ${SIGNER_BINARY_FILE} ${SIGNER_BINARY_LINK}
RUN apt-get -y update && \
apt-get -y install unzip && \
RUN apk update && \
apk add unzip && \
unzip -o ${SIGNER_BINARY_FILE}

# Build Go binary
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o kyverno-notation-aws .
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-w -s" -o kyverno-notation-aws .

FROM amd64/amazonlinux:2.0.20230207.0
RUN yum install tree -y
FROM scratch
WORKDIR /

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

# Notation home
ENV PLUGINS_DIR=/plugins

Expand Down

0 comments on commit 5e4a3b6

Please sign in to comment.