Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Added the removal of the package lists to reduce the image size after the install process.
  • Loading branch information
nhkhai committed May 3, 2024
1 parent f0015a3 commit 0786974
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ RUN ./mvnw clean install -DskipTests
FROM eclipse-temurin:21-jdk-jammy

# Install PostgreSQL and change PostgreSQL authentication to trust.
# Install the PostgreSQL package.
RUN apt-get update && apt-get install -y postgresql
# Install the PostgreSQL package. Remove the package lists to reduce the image size.
RUN apt-get update && apt-get install -y postgresql && && rm -rf /var/lib/apt/lists/*

# As a security best practice, switch to a non-root user with user privileges instead of root privileges.
# The USER Dockerfile instruction sets the preferred user name (or UID) and optionally the user group (or GID) while running the image — and for any subsequent RUN, CMD, or ENTRYPOINT instructions.
Expand Down

0 comments on commit 0786974

Please sign in to comment.