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 amazonlinux:2 to amazonlinux:2023 #982

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
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,6 +1,6 @@
FROM amazonlinux:2 AS graalvm
FROM amazonlinux:2023 AS graalvm
ENV LANG=en_US.UTF-8
RUN yum update -y && yum install -y gcc gcc-c++ libc6-dev zlib1g-dev curl bash zlib zlib-devel zlib-static zip tar gzip && yum clean all && rm -rf /var/cache/yum
RUN yum update -y && yum install -y gcc gcc-c++ glibc-devel curl-minimal bash zlib zlib-devel zlib-static zip tar gzip && yum clean all && rm -rf /var/cache/yum
RUN curl -4 -L https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_linux-aarch64_bin.tar.gz -o /tmp/graalvm.tar.gz \
&& mkdir -p /usr/lib/graalvm \
&& tar -zxf /tmp/graalvm.tar.gz -C /usr/lib/graalvm --strip-components 1 \
Expand All @@ -14,7 +14,7 @@ COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args -H:Class=io.micronaut.function.aws.runtime.MicronautLambdaRuntime -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

FROM amazonlinux:2
FROM amazonlinux:2023
WORKDIR /function
RUN yum update -y && yum install -y zip && yum clean all
COPY --from=graalvm /home/app/application /function/func
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM amazonlinux:2 AS graalvm
FROM amazonlinux:2023 AS graalvm
ENV LANG=en_US.UTF-8
RUN yum update -y && yum install -y gcc gcc-c++ libc6-dev zlib1g-dev curl bash zlib zlib-devel zlib-static zip tar gzip && yum clean all && rm -rf /var/cache/yum
RUN yum update -y && yum install -y gcc gcc-c++ glibc-devel curl-minimal bash zlib zlib-devel zlib-static zip tar gzip && yum clean all && rm -rf /var/cache/yum
RUN curl -4 -L https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_linux-x64_bin.tar.gz -o /tmp/graalvm.tar.gz \
&& mkdir -p /usr/lib/graalvm \
&& tar -zxf /tmp/graalvm.tar.gz -C /usr/lib/graalvm --strip-components 1 \
Expand All @@ -14,7 +14,7 @@ COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args -H:Class=io.micronaut.function.aws.runtime.MicronautLambdaRuntime -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

FROM amazonlinux:2
FROM amazonlinux:2023
WORKDIR /function
RUN yum update -y && yum install -y zip && yum clean all
COPY --from=graalvm /home/app/application /function/func
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM amazonlinux:2 AS graalvm
FROM amazonlinux:2023 AS graalvm
ENV LANG=en_US.UTF-8
ARG GRAALVM_JVM_VERSION
ARG GRAALVM_ARCH
RUN yum update -y && yum install -y gcc gcc-c++ libc6-dev zlib1g-dev curl bash zlib zlib-devel zlib-static zip tar gzip && yum clean all && rm -rf /var/cache/yum
RUN yum update -y && yum install -y gcc gcc-c++ glibc-devel curl-minimal bash zlib zlib-devel zlib-static zip tar gzip && yum clean all && rm -rf /var/cache/yum
RUN curl -4 -L https://download.oracle.com/graalvm/${GRAALVM_JVM_VERSION}/latest/graalvm-jdk-${GRAALVM_JVM_VERSION}_linux-${GRAALVM_ARCH}_bin.tar.gz -o /tmp/graalvm.tar.gz \
&& mkdir -p /usr/lib/graalvm \
&& tar -zxf /tmp/graalvm.tar.gz -C /usr/lib/graalvm --strip-components 1 \
Expand All @@ -17,7 +17,7 @@ COPY *.args /home/app/graalvm-native-image.args
ARG CLASS_NAME
RUN native-image @/home/app/graalvm-native-image.args -H:Class=${CLASS_NAME} -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

FROM amazonlinux:2
FROM amazonlinux:2023
WORKDIR /function
RUN yum update -y && yum install -y zip && yum clean all
COPY --from=graalvm /home/app/application /function/func
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ command line:
Note that changing the base image to a totally different one than the default might break image building, since the rest
of the build steps expect a certain base image. By default, the native images are built from an `ghcr.io/graalvm/native-image-community` image.

In the case of AWS custom runtime, it starts from `amazonlinux:2`, and this cannot be changed. Also, in this case the
In the case of AWS custom runtime, it starts from `amazonlinux:2023`, and this cannot be changed. Also, in this case the
result is not a tagged Docker image, but a `function.zip` archive that contains the launch script and the native binary.
Essentially, what you need to upload to AWS Lambda. Also in this case, the Micronaut Maven Plugin will detect the host
operating system architecture (based on the `os.arch` Java system property) and will install the corresponding GraalVM
Expand Down
Loading