-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support builds for different architectures including arm64 #11673
Conversation
DryRun Security SummaryThe code changes involve updating and improving multiple Dockerfiles in the DefectDojo application by upgrading base images, simplifying installation processes, enhancing security through non-root users and environment variables, and separating static file generation across various container configurations including nginx-alpine, django-alpine, integration-tests-debian, django-debian, and nginx-debian. Expand for full summarySummary: The provided code changes are related to the Dockerfiles used in the DefectDojo application. The changes primarily focus on updating the base images, simplifying the installation process, and improving the overall security and maintainability of the Dockerfiles. The key changes include:
From an application security perspective, these changes are generally positive and help to improve the overall security posture of the application. The updates to the base images, the separation of concerns, and the use of environment variables and non-root users are all best practices for secure application deployment. However, it's important to review the contents of the Dockerfiles and associated scripts carefully to ensure that no sensitive information or potential vulnerabilities are introduced. Additionally, regular monitoring and updating of the base images and dependencies are crucial to maintain the application's security over time. Files Changed:
Code AnalysisWe ran |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
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.
I tested this locally and found good results
+1 on this, we are running pure ARM kubernetes now and cannot deploy defectdojo. |
80b9e7c
to
64001b6
Compare
@mazmar we'll try to publish arm64 images for releases. For now it could be interesting to see if you can build and deploy with the changes in this PR. It's based off the ’dev’ branch, so it's close to what will be 2.43.0 on Monday. |
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.
Approved
64001b6
to
d031780
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Description
Currently Defect Dojo base images are pinned to the
manifest digest
oflindex/amd64
images.This prevents users or systems from building on/for other architectures such as
linux/arm64
.This PR changes this into using
index digests
. These digests do not point to a singlelinux/amd64
image, but to the collection of images for all architectures.I couldn't find a good page where this is explained, so I asked ChatGPT:
Test results
AMD64:
The result is that when building on
linux/amd64
, the result is exactly the same as before. Docker will automatically pick thelinux/amd64
digest from the index digest. This will be the exact same digest we previously put into theDockerfile
/docker-compose.yml
files.ARM64:
When on
linux/arm64
, docker will now chooselinux/arm64
images foralpine
,debian
,postgres
, etc. And will builddjango
andnginx
images forlinux/arm64
.This allows users to build Defect Dojo on arm64 platforms, for example to run on the cheaper AWS Graviton instances.
It might also help users/developers on MacOS, not sure as I don't have a Mac myself.
Builds and smoke test done on AWS t4g instance.
Next steps
Next step would be for us to also build arm64 images and publish them on Docker Hub.
Currently our builds are running in GitHub actions on AMD64 runners. We could build these arm64 images using Qemu.
I've noticed that these builds are not always succeeding, mainly because compilation of Python wheels like uwsgi are failing.
I will look into running an arm64 build on a native arm64 GitHub runner image, but this requires some fiddling to get the index digest to be created correctly.
Let's start with this PR to help people get started on arm64.
Additional info
This PR also simplifies the
node
install process for thealpine
builds. I am not aware of any need to buildnode
from source, we can justadd
thealpine
package.