diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1e3ae78 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +ARG IMAGE_BASE=clojure +ARG BUILD_IMAGE=${IMAGE_BASE}:temurin-17-lein-bookworm +ARG RUN_IMAGE=${BUILD_IMAGE}-slim + +FROM ${BUILD_IMAGE} AS build +WORKDIR /maelstrom + +# TODO: Figure out which files to ignore +COPY . . + +RUN lein deps +RUN lein uberjar +RUN mv /maelstrom/target/maelstrom*standalone.jar /maelstrom/maelstrom.jar + +FROM ${RUN_IMAGE} AS run +WORKDIR /maelstrom + +COPY --from=build /maelstrom/maelstrom.jar /maelstrom/maelstrom.jar + +# maelstrom requires explicit root user within Docker +USER root +ENTRYPOINT ["java", "-Djava.awt.headless=true", "-jar", "/maelstrom/maelstrom.jar"] diff --git a/README.md b/README.md index 345f43c..1a59eb3 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,25 @@ For transactional tests, you can control transaction generation using SSH options are unused; Maelstrom runs entirely on the local node. + + ## Troubleshooting ### Running ./maelstrom complains it's missing maelstrom.jar