Skip to content

Commit

Permalink
layered images must not be executable springboot apps
Browse files Browse the repository at this point in the history
  • Loading branch information
openwms committed Jun 12, 2023
1 parent 17918e8 commit e3123a3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build
run: >
./mvnw clean verify
Expand Down
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
FROM openjdk:17.0.1-oracle as builder
WORKDIR application
ARG JAR_FILE=target/openwms-configuration-exec.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

FROM openjdk:17.0.1-oracle
ARG JAVA_OPTS="-Xss512k"
ADD target/openwms-configuration-exec.jar app.jar
ENTRYPOINT exec java $JAVA_OPTS -jar /app.jar
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/spring-boot-loader/ ./
COPY --from=builder application/snapshot-dependencies/ ./
COPY --from=builder application/application/ ./
ENTRYPOINT exec java $JAVA_OPTS org.springframework.boot.loader.JarLauncher
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
</execution>
</executions>
<configuration>
<executable>true</executable>
<layers>
<configuration>${project.basedir}/src/layers.xml</configuration>
<enabled>true</enabled>
Expand Down

0 comments on commit e3123a3

Please sign in to comment.