-
-
Notifications
You must be signed in to change notification settings - Fork 702
Dockerfile tweaks #5657
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
Dockerfile tweaks #5657
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Pull request overview
This PR modernizes the Dockerfile configurations for Dependency-Track with several improvements focused on best practices and compatibility.
Key changes:
- Converts CMD and HEALTHCHECK directives to JSON array notation for better signal handling
- Adds
--sun-misc-unsafe-memory-access=allowflag to suppress Lucene-related warnings in Java 25 - Replaces wget with curl for health checks to maintain consistent command-line flags across Alpine and Debian base images
- Removes unnecessary
|| trueand|| exit 1error handling from user/group creation commands - Adds explicit
--chownflags to COPY directives for clearer ownership management
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main/docker/Dockerfile | Updates Debian-based Dockerfile with JSON array notation, curl installation, --chown flags, and Java 25 unsafe memory access flag |
| src/main/docker/Dockerfile.alpine | Updates Alpine-based Dockerfile with JSON array notation, curl installation, --chown flags, and Java 25 unsafe memory access flag |
| src/main/docker/docker-compose.yml | Comments out healthcheck configuration (now handled by Dockerfile) with Podman Compose compatibility note and updates curl syntax |
| dev/docker-compose.yml | Changes image tag to snapshot-alpine variant and removes healthcheck override |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Uses recommended JSON array notation for `CMD` directives. * Suppresses warnings for `sun.misc.Unsafe` usage (for Lucene) emitted by Java 25. * Removes undesired `|| true` and `|| exit 1` occurrences as they don't provide any benefit. * Specifies `--chown` for COPY directives to make ownership more explicit. * Switches from `wget` to `curl` for health check as it has the same flags in Alpine and Debian, which wget does not have. Signed-off-by: nscuro <[email protected]>
7aa42d2 to
a6f962a
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Description
CMDdirectives.sun.misc.Unsafeusage (for Lucene) emitted by Java 25.|| trueand|| exit 1occurrences as they don't provide any benefit.--chownfor COPY directives to make ownership more explicit.wgettocurlfor health check as it has the same flags in Alpine and Debian, which wget does not have.Addressed Issue
N/A
Additional Details
N/A
Checklist
This PR fixes a defect, and I have provided tests to verify that the fix is effectiveThis PR introduces changes to the database model, and I have added corresponding update logicThis PR introduces new or alters existing behavior, and I have updated the documentation accordingly