Skip to content
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

[4.x] LRA coordinator docker fix #6727

Merged
merged 1 commit into from
May 2, 2023
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
3 changes: 1 addition & 2 deletions examples/microprofile/lra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Build and run

With JDK11+
```bash
mvn install && java -jar ./target/helidon-examples-microprofile-lra.jar
```
Expand All @@ -18,7 +17,7 @@ mp.lra.coordinator.url: http://localhost:8070/lra-coordinator

```shell
docker build -t helidon/lra-coordinator https://github.com/oracle/helidon.git#:lra/coordinator/server
docker run -dp 8070:8070 --name lra-coordinator --network="host" helidon/lra-coordinator
docker run --rm --name lra-coordinator --network="host" helidon/lra-coordinator
```

### Test LRA resource
Expand Down
36 changes: 21 additions & 15 deletions lra/coordinator/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 Oracle and/or its affiliates.
# Copyright (c) 2021, 2023 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,33 +14,39 @@
# limitations under the License.
#

FROM maven:3.6.3-openjdk-17-slim as build
FROM container-registry.oracle.com/java/openjdk:20 as build

WORKDIR /helidon
ARG HELIDON_BRANCH=master
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
ARG HELIDON_BRANCH=main
ARG HELIDON_REPOSITORY=oracle/helidon

ENV HELIDON_BRANCH ${HELIDON_BRANCH}
ENV HELIDON_REPOSITORY ${HELIDON_REPOSITORY}

RUN apt-get -qq update && apt-get -qq -y install wget unzip git
RUN wget -q -O helidon_repo.zip https://github.com/${HELIDON_REPOSITORY}/archive/refs/heads/${HELIDON_BRANCH}.zip

RUN unzip helidon_repo.zip -d ./helidon_repo

RUN mv ./helidon_repo/*/* ./
RUN dnf -y update && dnf -y install wget unzip git
RUN wget -q -O helidon_repo.zip https://github.com/${HELIDON_REPOSITORY}/archive/refs/heads/${HELIDON_BRANCH}.zip && \
unzip helidon_repo.zip -d ./helidon_repo && mv ./helidon_repo/*/* ./

# Build only required modules
RUN mvn install -pl :helidon-lra-coordinator-server -am -DskipTests

RUN echo "Helidon LRA Coordinator build successfully fished"
RUN mvn install -pl :helidon-lra-coordinator-server -am -DskipTests && \
echo "Helidon LRA Coordinator build successfully finished"

FROM openjdk:17-jdk-slim
FROM container-registry.oracle.com/java/openjdk:20
WORKDIR /helidon

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

CMD ["java", "-jar", "helidon-lra-coordinator-server.jar"]
CMD ["java", "--enable-preview", "-jar", "helidon-lra-coordinator-server.jar"]

EXPOSE 8070