-
Notifications
You must be signed in to change notification settings - Fork 141
Rework AL2 dockerfiles #967
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
- Rework dockerfiles for cleaner build - Update Makefile targets
|
||
.PHONY: build | ||
build: | ||
docker system prune -f |
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.
To confirm - was running this cleanup command unnecessary to begin with? Is that why it is no longer present after these changes? Or is it because there is some incompatibility between running this command and the reworking of Dockerfiles via this pull request?
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.
Per docs:
Remove all unused containers, networks, images (both dangling and unused), and optionally, volumes.
Which in practice would cleanup the intermediary build stage images. What is a bit problematic is that it also cleanup up containers, networks, images, volumes not generated by this project and felt like overreach.
If we feel strongly about thet cleanup, we could rework it to docker image prune -f
and sprinkle it as the last step in each Makefile target that uses docker build
or scripts that do
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.
Got it, thanks! I have a slight preference toward that, but not a blocker for me.
Unblock a pending release This reverts commit 49c943b.
- Rework dockerfiles for cleaner build - Update Makefile targets
Summary
export DOCKER_BUILDKIT=1
was added to buildspec to enable buildkit which was required for using newer features like -COPY --chmod=0755 entrypoint.sh /entrypoint.sh
Where did my Dockerfile* go?
The following dockerfiles are new:
The following dockerfiles were removed/merged:
What Makefile changes occurred?
The following targets were introduced:
The following targets were updated:
The following targets were removed:
Why this change
The current Dockerfiles had duplication of purpose and make it a bit more difficult to re-use when targeting newer OS releases. This is an attempt to split out concerns across:
Additionally output images are tagged with $AL_TAG or 2 to assist with multi-stage builds targeting the correct Dockerfile stage. This is required to enable building for newer OSes as we expect to override AL_TAG and need to target the specific build stage and not a generic (or rebuild the stage).
How this moves closer to AL2023
With this change in place, we can look to create new Makefile targets for AL2023 for release/debug and provide overrides for AL_TAG, FLB_VERSION, FLB_REPOSITORY like:
We need to create dockerfiles in scripts/dockerfiles for build/Dockerfile.deps-al2023 (build dependencies) and runtime/Dockerfiles.deps-al2023 (runtime dependencies).
Testing
Testing was conducted in a few phases:
For 1, this required running each Makefile target. For image producing targets, both
docker system prune -a -f
anddocker image prune -a -f
was run to ensure a clean slate between runs. This identified any Maekfile target dependencies.For 2, this required running the following images:
For 3, ran the build through a pipeline account and ensured the images built to amazon/aws-for-fluent-bit-test matching the expected as follows:
Images pushed/manifests can be observed in buildspec.yml. Also testing that these images function as expected.
make debug
succeeded: yesInteg tests succeeded: yes (local/build system)
New tests cover the changes: no
Description for the changelog
Rework AL2 dockerfiles
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.