Skip to content

Commit

Permalink
FIX: NAV-107 - Fix docker build
Browse files Browse the repository at this point in the history
- Ignore git specifics in docker build to not expose git specifics in production images.
  • Loading branch information
munterfi committed Aug 14, 2024
1 parent f35df76 commit ed15b72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COPY .mvn/ .mvn
COPY mvnw pom.xml ./
RUN ./mvnw dependency:go-offline -B
COPY src ./src
RUN ./mvnw clean package -DskipTests
RUN ./mvnw clean package -DskipTests -Pdocker-build

FROM openjdk:21-jdk-slim
WORKDIR /app
Expand Down
15 changes: 14 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,27 @@
<java.version>21</java.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<git.commit.id.skip>false</git.commit.id.skip>
</properties>

<profiles>
<profile>
<id>docker-build</id>
<properties>
<git.commit.id.skip>true</git.commit.id.skip>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>9.0.1</version>
<configuration>
<skip>${git.commit.id.skip}</skip>
</configuration>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -124,7 +137,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.3</version>
<version>5.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit ed15b72

Please sign in to comment.