-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multi stage Dockerfile to build Trace Compass Server
1. The stage "packager" use the image of tracecompass 2. The stage "packager" installs the minimum package needed to compile tracecompass.incubator 3. Then it will copy the project inside the container 4. Then it will run the command to build tracecompass.incubator 5. After the build, it will go to the next stage, and it will install the bare minimum configuration to run the tracecompass-server. 6. Then it copies the tracecompass-server already compiled from the previous stage into the current stage 7. Then it will run the trace-server on port 8080 [Added] Multi stage Dockerfile to build Trace Compass Server This change therefore depends on the mainline, core TC change [1] below. [1]https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/199945 Change-Id: I969847adab55d885d4250e947d36cb0e34953802 Signed-off-by: Ahmad Faour <ahmad.faour@polymtl.ca> Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/199977 Reviewed-by: Marco Miller <marco.miller@ericsson.com> Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org> Tested-by: Marco Miller <marco.miller@ericsson.com>
- Loading branch information
1 parent
1f1002f
commit b053fb3
Showing
4 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Compiled output | ||
**/target/ | ||
workspace/ | ||
**/bin/ | ||
*/.settings/org.sonar.ide.eclipse.core.prefs | ||
.polyglot.build.properties | ||
.tycho-consumer-pom.xml | ||
|
||
# Git | ||
.git* | ||
!.git/ | ||
|
||
# Markdown files | ||
*.md | ||
|
||
# IDEs and editors | ||
.vscode/* | ||
.history/* | ||
.devcontainer/ | ||
|
||
# Dockerfiles | ||
Dockerfile* | ||
|
||
# System files | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ | |
bin/ | ||
target/ | ||
workspace/ | ||
|
||
# VS Code | ||
.devcontainer | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (c) 2023 Polytechnique de Montréal | ||
# | ||
# All rights reserved. This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 which | ||
# accompanies this distribution, and is available at | ||
# https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
|
||
ARG VARIANT=latest | ||
FROM tracecompass:${VARIANT} as packager | ||
|
||
ENV JAVA_MINIMAL="/opt/java-minimal" | ||
|
||
RUN apk --no-cache add openjdk17-jdk openjdk17-jmods maven && \ | ||
# build minimal JRE | ||
/usr/lib/jvm/java-17-openjdk/bin/jlink \ | ||
--verbose \ | ||
--add-modules \ | ||
java.base,java.sql,java.naming,java.desktop,java.management,java.security.jgss,java.instrument,jdk.unsupported \ | ||
--compress 2 --no-header-files --strip-java-debug-attributes --no-man-pages \ | ||
--output "$JAVA_MINIMAL" | ||
|
||
COPY ./ /app/ | ||
|
||
WORKDIR /app/ | ||
|
||
RUN mvn clean install -DskipTests | ||
|
||
FROM alpine:3.16.0 | ||
|
||
ENV JAVA_HOME=/opt/java-minimal | ||
ENV PATH="$PATH:$JAVA_HOME/bin" | ||
|
||
# Required dependency for Eclipse Trace Compass Server | ||
RUN apk --no-cache add libc6-compat | ||
|
||
COPY --from=packager "$JAVA_HOME" "$JAVA_HOME" | ||
COPY --from=packager /app/trace-server/org.eclipse.tracecompass.incubator.trace.server.product/target/products/traceserver/linux/gtk/x86_64/trace-compass-server /usr/src/tracecompass | ||
|
||
WORKDIR /usr/src/tracecompass | ||
EXPOSE 8080 | ||
CMD ["./tracecompass-server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters