Skip to content

Commit fb04961

Browse files
committed
chore(container): simplify creation of dynamically allocated system user
1 parent 38e657d commit fb04961

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ COPY --chmod=555 scripts/healthcheck.sh ./healthcheck.sh
5757
# Copy pre-seeded SQLite database as init bundle
5858
COPY --from=builder /src/Dotnet.Samples.AspNetCore.WebApi/storage/players-sqlite3.db ./docker-compose/players-sqlite3.db
5959

60-
# Create non-root user and make volume mount point writable
61-
RUN adduser --disabled-password --gecos '' aspnetcore && \
60+
# Add non-root user and make volume mount point writable
61+
RUN adduser --system --disabled-password --group aspnetcore && \
6262
mkdir -p /storage && \
63-
chown -R aspnetcore:aspnetcore /storage
63+
chown aspnetcore:aspnetcore /storage
6464

6565
USER aspnetcore
6666

0 commit comments

Comments
 (0)