-
Notifications
You must be signed in to change notification settings - Fork 142
Add AL2023 dockerfiles #974
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
Conversation
- Add support for AL2023 through dependency dockerfiles - Fix core_uploader.sh check for no core files via fuzzy matching
cyrus-sasl-lib \ | ||
libstdc++ | ||
|
||
# Final minimal runtime image using scratch base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the "final runtime image" need to have the fluent-bit binary copied in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the doc you referenced, I was expecting the fluent-bit Dockerfile to look more like this one, in which dependencies and the fluent-bit compilation both happen in a "build" step, and then both the dependencies and the fluent-bit binary are copied into the final image together. (obviously replacing the hello world app with fluent-bit in this example):
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 as build
COPY hello-world.c /
RUN dnf -y install gcc
RUN gcc -o hello-world hello-world.c
RUN mkdir /sysroot
RUN mv hello-world /sysroot/
RUN dnf --releasever=$(rpm -q system-release --qf '%{VERSION}') \
--installroot /sysroot \
-y \
--setopt=install_weak_deps=False \
install glibc && dnf --installroot /sysroot clean all
FROM scratch
COPY --from=build /sysroot /
WORKDIR /
ENTRYPOINT ["/hello-world"]
EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the AL2 dockerfile rework we pass in a RUNTIME_IMAGE to dockerfiles containing the dependencies for the platform
Line 77 in bd01285
docker build $(DOCKER_BUILD_FLAGS) --build-arg COMPILE_IMAGE=amazon/aws-for-fluent-bit:compile-al${AL_TAG} --build-arg RUNTIME_IMAGE=amazon/aws-for-fluent-bit:runtime-deps-al${AL_TAG} -t amazon/aws-for-fluent-bit:latest-al${AL_TAG} -f ./scripts/dockerfiles/runtime/Dockerfile . |
Then inside the folliow-up dockerfiles we copy in the required binaries/plugins
aws-for-fluent-bit/scripts/dockerfiles/runtime/Dockerfile
Lines 4 to 12 in bd01285
# Source compiled Fluent Bit binary and configuration | |
FROM ${COMPILE_IMAGE} as fluent-bit | |
# Source AWS plugins | |
FROM aws-fluent-bit-plugins:latest as plugins | |
# Final runtime assembly stage | |
FROM ${RUNTIME_IMAGE} | |
# Copy Fluent Bit binary and configuration from compile stage | |
COPY --from=fluent-bit /fluent-bit /fluent-bit |
Summary
Note: no new makefile targets are introduced using the AL2023 dockerfiles, this will be part of a follow-up commits
AL2023 build dependencies only have a few minor differences from AL2:
AL2023 runtime dependencies follow https://docs.aws.amazon.com/linux/al2023/ug/barebones-containers.html to install a small set of a dependencies that are copied into a scratch image reducing overall vulnerability surface area.
Testing
make debug
succeeded: yesInteg tests succeeded: yes
New tests cover the changes: no
Description for the changelog
Add AL2023 dockerfiles
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.