Skip to content

Commit

Permalink
Get JDK and linux images from container-registry.oracle.com
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed May 9, 2024
1 parent 90d9391 commit d3337d0
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@

# 1st stage, build the app
FROM maven:3.8.4-openjdk-17-slim as build
FROM container-registry.oracle.com/java/jdk-no-fee-term:17 as build

WORKDIR /usr/share

# Install maven
RUN set -x && \
curl -O https://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz && \
tar -xvf apache-maven-*-bin.tar.gz && \
rm apache-maven-*-bin.tar.gz && \
mv apache-maven-* maven && \
ln -s /usr/share/maven/bin/mvn /bin/

WORKDIR /helidon

Expand All @@ -19,7 +29,7 @@ RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage

FROM debian:stretch-slim
FROM container-registry.oracle.com/os/oraclelinux:9-slim
WORKDIR /helidon
COPY --from=build /helidon/target/{{artifactId}}-jri ./
ENTRYPOINT ["/bin/bash", "/helidon/bin/start"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@

# 1st stage, build the app
FROM maven:3.8.4-openjdk-17-slim as build
FROM container-registry.oracle.com/java/jdk-no-fee-term:17 as build

WORKDIR /usr/share

# Install maven
RUN set -x && \
curl -O https://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz && \
tar -xvf apache-maven-*-bin.tar.gz && \
rm apache-maven-*-bin.tar.gz && \
mv apache-maven-* maven && \
ln -s /usr/share/maven/bin/mvn /bin/

WORKDIR /helidon

Expand All @@ -22,7 +32,7 @@ RUN mvn package -DskipTests
RUN echo "done!"

# 2nd stage, build the runtime image
FROM openjdk:17-jdk-slim
FROM container-registry.oracle.com/java/jdk-no-fee-term:17
WORKDIR /helidon

# Copy the binary built in the 1st stage
Expand Down
36 changes: 36 additions & 0 deletions docs-internal/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Helidon Examples

The Helidon examples have moved out of the main Helidon repository (`helidon`) into
the Helidon examples repository (`helidon-examples`).

This creates a potential chicken-and-egg issue with the examples validation check that is run on PRs.
This document describes how we handle that situation.

## Example Validation Check

The primary Helidon repository contains a validation check for examples. This check
pulls the development branch for the corresponding major version from `helidon-examples`
(for example `dev-3.x`) and builds it to verify the PR has not broken examples.

This check *is not required*, because there are times when a fix in the primary repository
might legitimately break an example. Therefore if this check fails it will not block
merging of the PR.

Of course breaking examples is a red flag that you might be introducing an incompatibility. So
make sure you fully understand why the example broke and if you are introducing an incompatibility.

## Workflow

Let's assume you need to update the primary repository and an example because your change to the primary
repository breaks an example. You wish you could do this at the same time in one PR -- but you can't.
Here is the workflow:

1. Create the PR against the primary repository (`helidon`) with the "breaking" change. The example validation will fail.
2. Create a PR against the example repository (`helidon-examples`) with the fix for the example. The build check might fail.
3. Add a comment to the first PR describing why the example check fails, why this isn't a compatiblity issue, and include a link to the second PR (that fixes the example).
4. Have the first PR reviewed and merge it (the example check will not block merging)
5. Re-run the build validation on the second PR. It will now pass
6. Have the second PR reviewed and merge it.

All done!

4 changes: 2 additions & 2 deletions lra/coordinator/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

FROM container-registry.oracle.com/java/openjdk:17 as build
FROM container-registry.oracle.com/java/jdk-no-fee-term:17 as build

WORKDIR /usr/share

Expand All @@ -41,7 +41,7 @@ RUN wget -q -O helidon_repo.zip https://github.com/${HELIDON_REPOSITORY}/archive
RUN mvn install -pl :helidon-lra-coordinator-server -am -DskipTests && \
echo "Helidon LRA Coordinator build successfully finished"

FROM container-registry.oracle.com/java/openjdk:17
FROM container-registry.oracle.com/java/jdk-no-fee-term:17
WORKDIR /helidon

COPY --from=build /helidon/lra/coordinator/server/target/helidon-lra-coordinator-server.jar ./
Expand Down

0 comments on commit d3337d0

Please sign in to comment.