Skip to content

Commit

Permalink
6470 LRA coordinator docker fix (#6725)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkec authored May 23, 2023
1 parent f2b56e6 commit 6cc1f05
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
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
34 changes: 20 additions & 14 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,28 +14,34 @@
# limitations under the License.
#

FROM maven:3.6.3-openjdk-17-slim as build
FROM container-registry.oracle.com/java/openjdk:17 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=helidon-3.x
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:17
WORKDIR /helidon

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

0 comments on commit 6cc1f05

Please sign in to comment.