Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
FROM fnproject/fn-java-fdk-build:jdk17-1.0-latest as build-stage
WORKDIR /function
ENV MAVEN_OPTS -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -Dhttp.nonProxyHosts= -Dmaven.repo.local=/usr/share/maven/ref/repository
ADD pom.xml /function/pom.xml
RUN ["mvn", "package", "dependency:copy-dependencies", "-DincludeScope=runtime", "-DskipTests=true", "-Dmdep.prependGroupId=true", "-DoutputDirectory=target", "--fail-never"]
ADD src /function/src
RUN ["mvn", "package"]

FROM container-registry.oracle.com/graalvm/native-image:23-ol8 AS native
WORKDIR /app

COPY target .
COPY --from=build-stage /function/target .
ADD reflection.json .

RUN native-image \
-H:ReflectionConfigurationFiles=/app/reflection.json \
-Ob \
-H:Name=Hello \
-cp "/app/Hellofunc-1.0-SNAPSHOT.jar:/app/lib/*" \
-cp "/app/Hellofunc-1.0-SNAPSHOT.jar:/app/*" \
com.fnproject.fn.runtime.EntryPoint

FROM fnproject/fn-java-fdk:jre17-1.0.198 as fdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ steps:
echo "Build ID: $buildId"
- type: Command
command: |
# This replaces the default open-jdk
export GRAALVM_VERSION="21"
export JAVA_VERSION="17"
yum -y install graalvm${GRAALVM_VERSION}-ee-${JAVA_VERSION}-jdk;
export JAVA_HOME=/usr/lib64/graalvm/graalvm${GRAALVM_VERSION}-ee-java${JAVA_VERSION};
java -version
mvn clean install
docker build -f Dockerfile.native -t ${REGISTRY}/${NAMESPACE}/${IMAGE_NAME} .
docker tag ${REGISTRY}/${NAMESPACE}/${IMAGE_NAME}:latest ${REGISTRY}/${NAMESPACE}/${IMAGE_NAME}:$buildId
outputArtifacts:
Expand Down