Skip to content

Commit

Permalink
Build: Fix Docker image
Browse files Browse the repository at this point in the history
This has been broken ever since the upgrade to Java 11 and moving tracks
to server resources. Now it works again and is tested in CI to ensure it
won't break again.
  • Loading branch information
StenAL committed Jul 1, 2024
1 parent a8dd482 commit 411acb0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ jobs:
run: sudo apt-get install -y genisoimage
- name: Build with Maven
run: mvn -B install --file pom.xml
- name: Build Docker image
uses: docker/build-push-action@v5
with:
tags: philippvk/minigolf:latest
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#
# Build stage
#
FROM maven:3.6.0-jdk-8-slim AS build
FROM maven:3.9.7-eclipse-temurin-21 AS build
COPY . /home/app/
RUN mvn -f /home/app/pom.xml -pl server -am clean package

#
# Package stage
#
FROM openjdk:8-alpine
FROM eclipse-temurin:21-alpine
COPY --from=build /home/app/server/target/server-*.jar /home/minigolf/server.jar
COPY tracks/ /home/minigolf/tracks/
EXPOSE 4242
WORKDIR /home/minigolf
ENTRYPOINT ["java","-jar","server.jar"]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ java -jar client.jar -server 192.168.1.7 -lang en_US # Replace IP with the one o

#### Running Minigolf Server in Docker Container

We provide an experimental Dockerfile for easy hosting of the server application. You can either build the image by yourself or download the pre-build images from [quay.io](https://quay.io/repository/philippvk/minigolf) via `docker pull quay.io/philippvk/minigolf:latest`.
We provide an experimental Dockerfile for easy hosting of the server application.
You can either build and run the image:
```sh
docker build -t pfmg .
docker run pfmg
```
or download the pre-built images from [quay.io](https://quay.io/repository/philippvk/minigolf) via `docker pull quay.io/philippvk/minigolf:latest`.

Running the Editor is quite straightforward as it can be started like expected: `java -jar editor.jar`

Expand Down

0 comments on commit 411acb0

Please sign in to comment.