Skip to content
Open
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
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ COPY pom.xml ./
COPY distro ./distro/

# Build the distro, but only deploy from the amd64 build
RUN --mount=type=secret,id=m2settings,target=/usr/share/maven/ref/settings-docker.xml if [[ "$MVN_ARGS" != "deploy" || "$(arch)" = "x86_64" ]]; then mvn $MVN_ARGS_SETTINGS $MVN_ARGS; else mvn $MVN_ARGS_SETTINGS install; fi
RUN --mount=type=secret,id=m2settings,target=/usr/share/maven/ref/settings-docker.xml \
--mount=type=cache,id=m2cache,target=/usr/share/maven/ref/repository \
if [[ "$MVN_ARGS" != "deploy" || "$(arch)" = "x86_64" ]]; \
then mvn $MVN_ARGS_SETTINGS $MVN_ARGS; \
else mvn $MVN_ARGS_SETTINGS install; \
fi

RUN cp /openmrs_distro/distro/target/sdk-distro/web/openmrs_core/openmrs.war /openmrs/distribution/openmrs_core/

Expand All @@ -22,7 +27,9 @@ RUN cp -R /openmrs_distro/distro/target/sdk-distro/web/openmrs_owas /openmrs/dis
RUN cp -R /openmrs_distro/distro/target/sdk-distro/web/openmrs_config /openmrs/distribution/openmrs_config/

# Clean up after copying needed artifacts
RUN mvn $MVN_ARGS_SETTINGS clean
RUN --mount=type=secret,id=m2settings,target=/usr/share/maven/ref/settings-docker.xml \
--mount=type=cache,id=m2cache,target=/usr/share/maven/ref/repository \
mvn $MVN_ARGS_SETTINGS clean

### Run Stage
# Replace 'nightly' with the exact version of openmrs-core built for production (if available)
Expand Down
Loading