Skip to content

Commit 343d62b

Browse files
committed
Optimize Dockerfile
1 parent f587dfc commit 343d62b

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ FROM openjdk:24-jdk-slim@sha256:df6c3a966c372fa314ec0dc428bf27f8aa28316a173d3d6e
55
RUN groupadd -g 1234 customgroup && \
66
useradd -m -u 1234 -g customgroup customuser
77

8-
# Switch to the custom user
9-
USER customuser
108
# Set the directory for executing future commands
119
WORKDIR /home/customuser
1210

13-
# Copy the app files from host machine to image filesystem
14-
COPY helidon/build/distributions/helidon-*.tar .
15-
RUN tar -xvf helidon-*.tar && rm helidon-*.tar && mv helidon-* app
11+
# Extract from .tar and copy the app files from host machine to image filesystem
12+
ADD helidon/build/distributions/helidon-*.tar .
13+
RUN mv helidon-* app && chown -R customuser:customgroup app
14+
15+
# Switch to the custom user
16+
USER customuser
1617

1718
# Run the Main class
1819
# https://docs.docker.com/reference/build-checks/json-args-recommended/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ curl -X PUT -d 'Howdy' http://localhost:8080/greet/greeting
5151
### Update version and add git tag
5252

5353
```shell
54-
git tag 2025.02
54+
git tag 2025.08
5555
```
5656

5757
## Update dependencies

0 commit comments

Comments
 (0)