Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
bored-engineer authored Mar 11, 2024
1 parent 00206d7 commit 1e65219
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# syntax=docker/dockerfile:1.7-labs

# Compile the Lambda binary
FROM public.ecr.aws/docker/library/golang:1.22.1-bullseye as builder
WORKDIR /app
COPY go.mod go.sum /app/
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.22.1-bullseye as builder
WORKDIR /src
COPY go.mod go.sum /src/
RUN go mod download
COPY lambda.go /app/
RUN go build -o /lambda
COPY lambda.go /src/
ARG TARGETOS TARGETARCH
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /lambda

# Final build layer will use provided.al2023 as the base
FROM public.ecr.aws/lambda/provided:al2023
Expand Down

0 comments on commit 1e65219

Please sign in to comment.