Skip to content

Commit bc3e0a5

Browse files
committed
fix(docker): use absolute path to run s3mock.jar
Also copy to "/opt/" instead of the root directory. Fixes #2827
1 parent e251c92 commit bc3e0a5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Whenever a 3rd party library is updated, S3Mock will update it's MINOR version.
117117
# PLANNED - 6.x - RELEASE TBD
118118
Version 6.x is JDK25 LTS bytecode compatible, with Docker integration.
119119

120-
Probably released with Spring Boot 5.x, updating baselines etc. as Spring Boot 5.x requires.
120+
Will be released after Spring Boot 5.x, updating baselines etc. as Spring Boot 5.x requires.
121121

122122
Any JUnit / direct Java usage support will most likely be dropped and only supported on a best-effort basis.
123123
(i.e., the modules will be deleted from the code base and not released anymore. It *may* be possible to
@@ -150,6 +150,7 @@ Version 5.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Jav
150150

151151
* Features and fixes
152152
* Get object with range now returns the same headers as non-range calls.
153+
* Docker: Copy "s3mock.jar" to "/opt/", run with absolute path reference to avoid issues when working directory is changed. (fixes #2827)
153154
* Refactorings
154155
* Use Jackson 3 annotations and mappers.
155156
* AWS has deprecated SDK for Java v1 and will remove support EOY 2025.

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ENV JAVA_HOME=/opt/java-minimal
5959
ENV PATH="$PATH:$JAVA_HOME/bin"
6060

6161
COPY --from=staging_area "$JAVA_HOME" "$JAVA_HOME"
62-
COPY ./target/s3mock-exec.jar s3mock.jar
62+
COPY ./target/s3mock-exec.jar /opt/s3mock.jar
6363

6464
ENV LANG=en_US.UTF-8
6565
ENV LANGUAGE=en_US:en
@@ -69,4 +69,4 @@ ENV root=/s3mockroot
6969
EXPOSE 9090 9191
7070

7171
# run the app on startup
72-
ENTRYPOINT ["java", "--illegal-access=warn", "-Djava.security.egd=file:/dev/./urandom", "-XX:+UseZGC", "-XX:+ZGenerational", "-jar", "s3mock.jar" ]
72+
ENTRYPOINT ["java", "--illegal-access=warn", "-Djava.security.egd=file:/dev/./urandom", "-XX:+UseZGC", "-XX:+ZGenerational", "-jar", "/opt/s3mock.jar" ]

0 commit comments

Comments
 (0)