-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Reduce number of layers for Beam container images #38440
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
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 |
|---|---|---|
|
|
@@ -24,22 +24,21 @@ ARG TARGETARCH | |
|
|
||
| ARG pull_licenses | ||
|
|
||
| ADD target/slf4j-api.jar /opt/apache/beam/jars/ | ||
| ADD target/slf4j-jdk14.jar /opt/apache/beam/jars/ | ||
| ADD target/jcl-over-slf4j.jar /opt/apache/beam/jars/ | ||
| ADD target/log4j-over-slf4j.jar /opt/apache/beam/jars/ | ||
| ADD target/log4j-to-slf4j.jar /opt/apache/beam/jars/ | ||
| ADD target/beam-sdks-java-harness.jar /opt/apache/beam/jars/ | ||
|
|
||
| # Required to use jamm as a javaagent to get accurate object size measuring | ||
| # COPY fails if file is not found, so use a wildcard for open-module-agent.jar | ||
| # since it is only included in Java 9+ containers | ||
| COPY target/jamm.jar target/open-module-agent.jar /opt/apache/beam/jars/ | ||
|
|
||
| COPY target/${TARGETOS}_${TARGETARCH}/boot /opt/apache/beam/ | ||
|
|
||
| COPY target/LICENSE /opt/apache/beam/ | ||
| COPY target/NOTICE /opt/apache/beam/ | ||
| # Dependency jars | ||
| COPY target/slf4j-api.jar \ | ||
| target/slf4j-jdk14.jar \ | ||
| target/jcl-over-slf4j.jar \ | ||
| target/log4j-over-slf4j.jar \ | ||
| target/log4j-to-slf4j.jar \ | ||
| # Required to use jamm as a javaagent to get accurate object size measuring | ||
| target/jamm.jar \ | ||
| /opt/apache/beam/jars/ | ||
|
Abacn marked this conversation as resolved.
|
||
|
|
||
| # Built jars | ||
| COPY target/open-module-agent.jar target/beam-sdks-java-harness.jar /opt/apache/beam/jars/ | ||
|
Contributor
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. The |
||
|
|
||
| # Built binary with licenses | ||
| COPY target/${TARGETOS}_${TARGETARCH}/boot target/LICENSE target/NOTICE /opt/apache/beam/ | ||
|
|
||
| # copy third party licenses | ||
| ADD target/third_party_licenses /opt/apache/beam/third_party_licenses/ | ||
|
Contributor
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. For local files and directories, |
||
|
|
||
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.
Use
COPYinstead ofADDfor local files when no extraction is required. This is a Docker best practice and maintains consistency with the improvements made in the Java Dockerfile.