Skip to content

Commit

Permalink
Use amazoncorretto instead of openjdk for arm support. Simplify docke…
Browse files Browse the repository at this point in the history
…r build.
  • Loading branch information
rkorytkowski committed Apr 29, 2024
1 parent b3f3977 commit ddb9920
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 4 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# This line tells Docker to base an image on a pre-built image with Alpine Linux. You can use other images from OpenJDK
# registry. Alpine Linux benefit is that the image is pretty small. We also select JRE-only image since we don't need
# to compile code on the image, only run precompiled classes.
FROM adoptopenjdk/openjdk11:alpine-jre

# If for some reason you wish to use the full JDK, the following line can be used
# FROM adoptopenjdk/openjdk11:alpine

ARG PROJECT_VERSION
RUN echo "Project version set to -> ${PROJECT_VERSION}"
# This line tells Docker to base an image on a pre-built image with Alpine Linux. You can use other images from Amazon
# Corretto registry. Alpine Linux benefit is that the image is pretty small.
FROM amazoncorretto:11-alpine3.19

ENV APPLICATION_USER ktor
RUN adduser -D -g '' $APPLICATION_USER
Expand All @@ -18,7 +11,7 @@ RUN chown -R $APPLICATION_USER /app
USER $APPLICATION_USER

# These lines copy the packaged application into the Docker image and sets the working directory to where it was copied.
COPY ./build/libs/validator-wrapper-jvm-${PROJECT_VERSION}.jar /app/validator-wrapper.jar
COPY ./build/libs/validator-wrapper-jvm-*.jar /app/validator-wrapper.jar
WORKDIR /app

# Environment vars here
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ version: '3'
services:
validator:
image: markiantorno/validator-wrapper
build:
context: .
restart: always
ports:
- 3500:3500

0 comments on commit ddb9920

Please sign in to comment.