Skip to content

Commit 3b0a757

Browse files
committed
fix(docker): update user creation for Ubuntu 24.04 base image (#368)
- Replace adduser with groupadd/useradd for Ubuntu compatibility - Document base OS change from Debian 12 to Ubuntu 24.04 in CHANGELOG Microsoft changed .NET 10 base images from Debian to Ubuntu, requiring updated user creation commands. This ensures CD pipeline builds successfully when publishing Docker images.
1 parent 41bc98c commit 3b0a757

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ This project uses famous football stadiums (A-Z) that hosted FIFA World Cup matc
6565
- Update Microsoft.EntityFrameworkCore.Sqlite to 10.0.0
6666
- Update Microsoft.EntityFrameworkCore.Design to 10.0.0
6767
- Update Microsoft.VisualStudio.Web.CodeGeneration.Design to 10.0.0
68-
- Update Docker images to .NET 10 SDK and runtime
68+
- Update Docker images to .NET 10 SDK and runtime (now based on Ubuntu 24.04 LTS instead of Debian 12)
69+
- Update Dockerfile user creation commands for Ubuntu compatibility (`groupadd`/`useradd` instead of `adduser`)
6970
- Update CI/CD pipelines to use .NET 10 SDK
7071
- Token efficiency strategy for Copilot/AI agents with optimized instruction loading and improved token counting script (#364)
7172
- Bump Swashbuckle.AspNetCore from 10.1.0 to 10.1.2

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ COPY --chmod=555 scripts/healthcheck.sh ./healthcheck.sh
5757
COPY --from=builder /src/Dotnet.Samples.AspNetCore.WebApi/storage/players-sqlite3.db ./hold/players-sqlite3.db
5858

5959
# Add non-root user and make volume mount point writable
60-
RUN adduser --system --disabled-password --group aspnetcore && \
60+
RUN groupadd -r aspnetcore && useradd -r -g aspnetcore aspnetcore && \
6161
mkdir -p /storage && \
6262
chown aspnetcore:aspnetcore /storage
6363

0 commit comments

Comments
 (0)