Dockerfile
Today I finished the first issue in the kubernetes testproject I’m playing around with.
The Dockerfile itself was fairly straightforward, so I thought I’d set up a GitHub action to build the Java application. At the moment I’m having a few issues combining two GitHub actions, one part for building the Jar and the second for Dockerizing the application, but at least I have something resembling a container up in the ghcr.io-registry.
The Dockerfile:
FROM eclipse-temurin:17-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java", "-jar", "/app.jar"]
Which is built with:
./mvnv build
docker build --build-arg JAR_FILE=target/api-0.0.1-SNAPSHOT.jar -t tcarisland/tcapi .
The notifications during action-development were a little annoying. Previously when I worked with GitHub-actions I found that the nektos/act project was very useful for local testing of actions. I should probably go back to using that for this project as well.