-
Notifications
You must be signed in to change notification settings - Fork 16
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
Update Dockerfile #445
Update Dockerfile #445
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,13 +1,12 @@ | ||||||||||
FROM gradle:7.6.0-jdk17 AS build | ||||||||||
FROM gradle:7-jdk17 AS build | ||||||||||
|
||||||||||
ARG BUILD_ARGS | ||||||||||
|
||||||||||
COPY --chown=gradle:gradle . /home/gradle/project/ | ||||||||||
WORKDIR /home/gradle/project/ | ||||||||||
RUN --mount=type=cache,target=/home/gradle/.gradle/caches gradle build --no-daemon $BUILD_ARGS | ||||||||||
|
||||||||||
# -buster is required to have apt available | ||||||||||
FROM openjdk:17-slim-buster | ||||||||||
FROM eclipse-temurin:17-alpine | ||||||||||
|
||||||||||
ARG EDC_LAST_COMMIT_INFO_ARG="The docker container was built outside of github actions and you didn't provide the build arg EDC_LAST_COMMIT_INFO_ARG, so there's no last commit info." | ||||||||||
ENV EDC_LAST_COMMIT_INFO=$EDC_LAST_COMMIT_INFO_ARG | ||||||||||
|
@@ -19,10 +18,10 @@ | |||||||||
ARG JVM_ARGS="" | ||||||||||
|
||||||||||
# Install curl, then delete apt indexes to save image space | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
RUN apt update \ | ||||||||||
&& apt install -y curl \ | ||||||||||
RUN apk update \ | ||||||||||
&& apk add curl \ | ||||||||||
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists \ | ||||||||||
Comment on lines
+21
to
23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
&& touch /emtpy-properties-file.properties | ||||||||||
Check failure Code scanning / Trivy 'apk add' is missing '--no-cache' High
Artifact: connector/Dockerfile
Type: dockerfile Vulnerability DS025 Severity: HIGH Message: '--no-cache' is missed: apk update && apk add curl && rm -rf /var/cache/apt/archives /var/lib/apt/lists && touch /emtpy-properties-file.properties Link: DS025 |
||||||||||
|
||||||||||
WORKDIR /app | ||||||||||
|
||||||||||
|
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.
The runtime layer shouldn't need a full JDK. Reduces base image size from ~200 MB to ~50 MB.