Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Python version of Lambda agent. #11

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# stage 1: build the lambda layer
FROM --platform=linux/x86_64 public.ecr.aws/lambda/python:3.9 AS builder
FROM --platform=linux/x86_64 public.ecr.aws/lambda/python:3.12 AS builder

# Copy requirements.txt
COPY requirements.txt /tmp/
Expand All @@ -9,14 +9,14 @@ COPY requirements.txt /tmp/
RUN pip install --force-reinstall --no-cache-dir \
-r /tmp/requirements.txt -t /build/python

# Install 'zip' utility (Amazon Linux uses yum)
RUN yum install -y zip
# Install 'zip' utility (Amazon Linux uses dnf)
RUN dnf install -y zip

# Create the ZIP file for the Lambda layer
RUN cd /build/python && zip -r /opt/bedrock_layer.zip .

# Stage 2: Build the Lambda function
FROM --platform=linux/x86_64 public.ecr.aws/lambda/python:3.9
FROM --platform=linux/x86_64 public.ecr.aws/lambda/python:3.12

# Copy the Lambda layer artifacts from the builder stage
COPY --from=builder /opt/bedrock_layer.zip /opt/
Expand Down