Skip to content

Commit

Permalink
Merge branch 'develop' into feat-java21-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
hawflau authored Nov 14, 2023
2 parents c45d4c3 + 1cc3ea5 commit 63205a9
Show file tree
Hide file tree
Showing 20 changed files with 253 additions and 52 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ on:
jobs:
run-workflow:
name: Parent PR Status Check
if: always()
# If any dependent jobs fails, this WF skips which won't block merging PRs
# calling always() is required for this WF to run all the time
if: github.repository_owner == 'aws' && always()
runs-on: ubuntu-latest
needs:
- build-single-arch
Expand Down Expand Up @@ -72,6 +74,7 @@ jobs:
- "nodejs16x"
- "nodejs18x"
- "provided_al2"
- "provided_al2023"
- "python38"
- "python39"
- "python310"
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ IS_nodejs14x := nodejs14.x
IS_nodejs16x := nodejs16.x
IS_nodejs18x := nodejs18.x
IS_provided_al2 := provided.al2
IS_provided_al2023 := provided.al2023
IS_python38 := python3.8
IS_python39 := python3.9
IS_python310 := python3.10
Expand Down Expand Up @@ -52,7 +53,7 @@ build-single-arch: pre-build

build-multi-arch: pre-build
docker build -f build-image-src/Dockerfile-$(RUNTIME) -t amazon/aws-sam-cli-build-image-$(IS_$(RUNTIME)):x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$(SAM_CLI_VERSION) --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 ./build-image-src
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --privileged --rm tonistiigi/binfmt --install arm64
docker build -f build-image-src/Dockerfile-$(RUNTIME) -t amazon/aws-sam-cli-build-image-$(IS_$(RUNTIME)):arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$(SAM_CLI_VERSION) --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 ./build-image-src

test: pre-build
Expand Down
15 changes: 12 additions & 3 deletions build-image-src/Dockerfile-dotnet6
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -19,8 +18,18 @@ RUN yum groupinstall -y development && \
libgmp3-dev \
zlib1g-dev \
libmpc-devel \
python3-devel \
&& yum clean all
amazon-linux-extras

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
19 changes: 15 additions & 4 deletions build-image-src/Dockerfile-dotnet7
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -19,12 +18,24 @@ RUN yum groupinstall -y development && \
libgmp3-dev \
zlib1g-dev \
libmpc-devel \
python3-devel \
amazon-linux-extras \
clang krb5-devel \
openssl-devel \
llvm \
libicu \
&& yum clean all
libicu

RUN yum remove -y python3 python3-devel

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
15 changes: 12 additions & 3 deletions build-image-src/Dockerfile-java11
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -19,8 +18,18 @@ RUN yum groupinstall -y development && \
libgmp3-dev \
zlib1g-dev \
libmpc-devel \
python3-devel \
&& yum clean all
amazon-linux-extras

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
15 changes: 12 additions & 3 deletions build-image-src/Dockerfile-java17
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -19,8 +18,18 @@ RUN yum groupinstall -y development && \
libgmp3-dev \
zlib1g-dev \
libmpc-devel \
python3-devel \
&& yum clean all
amazon-linux-extras

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
17 changes: 13 additions & 4 deletions build-image-src/Dockerfile-java8_al2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -21,9 +20,19 @@ RUN yum groupinstall -y development && \
liblzma-dev \
libxslt-devel \
libmpc-devel \
python3-devel \
java-1.8.0-openjdk-devel \
&& yum clean all
amazon-linux-extras \
java-1.8.0-openjdk-devel

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
15 changes: 12 additions & 3 deletions build-image-src/Dockerfile-nodejs12x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -24,8 +23,18 @@ RUN yum groupinstall -y development && \
libgmp3-dev \
zlib1g-dev \
libmpc-devel \
python3-devel \
&& yum clean all
amazon-linux-extras

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
15 changes: 12 additions & 3 deletions build-image-src/Dockerfile-nodejs14x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -24,8 +23,18 @@ RUN yum groupinstall -y development && \
libgmp3-dev \
zlib1g-dev \
libmpc-devel \
python3-devel \
&& yum clean all
amazon-linux-extras

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
15 changes: 12 additions & 3 deletions build-image-src/Dockerfile-nodejs16x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -24,8 +23,18 @@ RUN yum groupinstall -y development && \
libgmp3-dev \
zlib1g-dev \
libmpc-devel \
python3-devel \
&& yum clean all
amazon-linux-extras

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
16 changes: 12 additions & 4 deletions build-image-src/Dockerfile-nodejs18x
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ ENV PATH=/var/lang/bin:$PATH \
AWS_EXECUTION_ENV=AWS_Lambda_nodejs18.x \
NODE_PATH=/opt/nodejs/node18/node_modules:/opt/nodejs/node_modules:/var/runtime/node_modules

# Installing by yum at copied location
RUN yum groupinstall -y development && \
yum install -d1 -y \
yum \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -25,8 +23,18 @@ RUN yum groupinstall -y development && \
libgmp3-dev \
zlib1g-dev \
libmpc-devel \
python3-devel \
&& yum clean all
amazon-linux-extras

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
15 changes: 12 additions & 3 deletions build-image-src/Dockerfile-provided_al2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RUN yum groupinstall -y development && \
tar \
gzip \
unzip \
python3 \
jq \
grep \
curl \
Expand All @@ -21,8 +20,18 @@ RUN yum groupinstall -y development && \
liblzma-dev \
libxslt-devel \
libmpc-devel \
python3-devel \
&& yum clean all
amazon-linux-extras

# Install extras so that Python 3.8 is installable
# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
RUN amazon-linux-extras enable python3.8 && \
yum clean metadata && \
yum install -y python38 python38-devel && \
yum clean all && \
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \
python3 --version && \
pip3 --version

# Install AWS CLI
ARG AWS_CLI_ARCH
Expand Down
45 changes: 45 additions & 0 deletions build-image-src/Dockerfile-provided_al2023
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ARG IMAGE_ARCH
FROM public.ecr.aws/lambda/provided:al2023-$IMAGE_ARCH

RUN dnf install -y tar\
gzip \
unzip \
python3 \
jq \
grep \
make \
rsync \
binutils \
gcc-c++ \
procps \
libxslt-devel \
libmpc-devel \
python3-devel \
&& dnf clean all

# Install AWS CLI
ARG AWS_CLI_ARCH
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$AWS_CLI_ARCH.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip && ./aws/install && rm awscliv2.zip && rm -rf ./aws

# Install SAM CLI in a dedicated Python virtualenv
ARG SAM_CLI_VERSION
RUN curl -L "https://github.com/awslabs/aws-sam-cli/archive/v$SAM_CLI_VERSION.zip" -o "samcli.zip" && \
unzip samcli.zip && python3 -m venv /usr/local/opt/sam-cli && \
/usr/local/opt/sam-cli/bin/pip3 --no-cache-dir install -r ./aws-sam-cli-$SAM_CLI_VERSION/requirements/base.txt && \
/usr/local/opt/sam-cli/bin/pip3 --no-cache-dir install ./aws-sam-cli-$SAM_CLI_VERSION && \
rm samcli.zip && rm -rf aws-sam-cli-$SAM_CLI_VERSION

ENV PATH=$PATH:/usr/local/opt/sam-cli/bin

ENV LANG=en_US.UTF-8

# Wheel is required by SAM CLI to build libraries like cryptography. It needs to be installed in the system
# Python for it to be picked up during `sam build`
RUN pip3 install wheel

COPY ATTRIBUTION.txt /

# Compatible with initial base image
ENTRYPOINT []
CMD ["/bin/bash"]
Loading

0 comments on commit 63205a9

Please sign in to comment.