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

Add basic Dockerfile #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ For transactional tests, you can control transaction generation using

SSH options are unused; Maelstrom runs entirely on the local node.

<!--

TODO: Once there's an "official" Docker image, add official image link here and uncomment these docs:

### Docker Container Setup

If you want to build the Docker container, you can run:
```sh
docker build -t maelstrom:latest .
```

And then you can run the CLI with:

```sh
docker run maelstrom:latest
```

-->

## Troubleshooting

### Running ./maelstrom complains it's missing maelstrom.jar
Expand Down