Skip to content

Commit 889d14d

Browse files
authored
Merge pull request #1871 from sap-contributions/smaller-catnip-image
Reduce size of catnip image
2 parents aec9436 + 24b8c31 commit 889d14d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

assets/catnip/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
FROM golang
1+
FROM --platform=$BUILDPLATFORM golang AS builder
2+
ARG TARGETOS
3+
ARG TARGETARCH
24
WORKDIR /go/src/app
35
COPY ./ ./
46

5-
RUN go build -o /go/bin/catnip /go/src/app/main.go
7+
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /go/bin/catnip /go/src/app/main.go
8+
9+
FROM --platform=$TARGETPLATFORM alpine
10+
COPY --from=builder /go/bin/catnip /go/bin/catnip
11+
12+
RUN apk add --no-cache ca-certificates bash curl lsb-release
613

714
ENV PORT=8080
815
CMD ["/go/bin/catnip"]

0 commit comments

Comments
 (0)