You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? If yes, please describe.
Currently, the jar file is not removed from the container image after unpacking the jar. That unnecessarily bloats the resulting image by 30-40MiB.
Describe the solution you'd like
Use a multistage build to unpack the jar file and then only copy the unpacked files to the final image.
Also use build arguments to keep version information in one place (and update the release script accordingly).
For example, for the Athena connector:
# Use an intermediate build image to unpack the jarFROM public.ecr.aws/lambda/java:11 AS build
ARG VERSION="2022.47.1"RUN mkdir /build
WORKDIR /build
# Copy function code and runtime dependencies from Maven layoutCOPY target/athena-postgresql-${VERSION}.jar .
# Unpack the jarRUN jar xf athena-postgresql-${VERSION}.jar && rm -f athena-postgresql-${VERSION}.jar
# Build the runtime image without any unnecessary layersFROM public.ecr.aws/lambda/java:11
COPY --from=build /build ${LAMBDA_TASK_ROOT}
# Command can be overwritten by providing a different command in the template directly.# No need to specify here (already defined in athena-postgresql.yaml because has two different handlers)
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? If yes, please describe.
Currently, the jar file is not removed from the container image after unpacking the jar. That unnecessarily bloats the resulting image by 30-40MiB.
Describe the solution you'd like
Use a multistage build to unpack the jar file and then only copy the unpacked files to the final image.
Also use build arguments to keep version information in one place (and update the release script accordingly).
For example, for the Athena connector:
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: