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

Dockerfile #204

Open
this-kramer opened this issue Mar 21, 2023 · 0 comments
Open

Dockerfile #204

this-kramer opened this issue Mar 21, 2023 · 0 comments

Comments

@this-kramer
Copy link
Member

It would be nice, if our Dockerfile would build and jar the services itself, currently it assumes the services are already built and jarred.

Some highly WIP code:

# syntax=docker/dockerfile:experimental
FROM openjdk:11-jdk-slim as build
ARG APPLICATION
ENV ENTRYPOINT_APP_ENV=$APPLICATION
ENV SERVICE=basket

WORKDIR /workspace/app

COPY . /workspace/app
WORKDIR /workspace/app/services
# RUN --mount=type=cache,target=/root/.gradle ./gradlew clean build
RUN ./gradlew clean build
RUN mkdir -p ${SERVICE}/build/dependency && (cd ${SERVICE}/build/dependency; jar -xf ../libs/*.jar)

FROM openjdk:11-jdk-slim
VOLUME /tmp
ARG DEPENDENCY=/workspace/app/services/${SERVICE}/build/dependency
RUN echo "foo"
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
COPY --from=build ${DEPENDENCY}/../../../jni/libmcljava.so /usr/lib/libmcljava.so
ENTRYPOINT java -cp app:app/lib/* ${ENTRYPOINT_APP_ENV}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant