Skip to content

Commit

Permalink
optimize Dockerfile build
Browse files Browse the repository at this point in the history
  • Loading branch information
mvysny committed Dec 9, 2024
1 parent 1eedcea commit 36d4e49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

# The "Build" stage. Copies the entire project into the container, into the /app/ folder, and builds it.
FROM eclipse-temurin:17 AS BUILD
RUN apt update && apt install unzip -y
COPY . /app/
WORKDIR /app/
RUN ./mvnw -C clean test package -Pproduction
RUN ./mvnw -C -e clean package -Pproduction
WORKDIR /app/target/
RUN ls -la
RUN unzip *.zip -d app/
RUN mkdir app && tar xvzf *.tar.gz -C app
# At this point, we have the app (executable bash scrip plus a bunch of jars) in the
# /app/target/app/ folder.

Expand Down
1 change: 1 addition & 0 deletions src/main/assembly/zip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<id>zip</id>
<formats>
<format>zip</format>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
Expand Down

0 comments on commit 36d4e49

Please sign in to comment.