Skip to content

Commit

Permalink
Don't change USER instruction in CBL Mariner distroless
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussell committed Mar 22, 2023
1 parent 90a520d commit 2d48ef9
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ COPY --from=installer --chown={{uid}}:{{gid}} {{distrolessStagingDir}}/home/{{us
"uid": uid
])}}

USER $APP_UID
USER app
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true

USER $APP_UID
USER app
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ ENV \
# Set the invariant mode since ICU package isn't included (see https://github.com/dotnet/announcements/issues/20)
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true

USER $APP_UID
USER app
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ ENV \
# Set the invariant mode since ICU package isn't included (see https://github.com/dotnet/announcements/issues/20)
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true

USER $APP_UID
USER app
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ ENV \
# Set the invariant mode since ICU package isn't included (see https://github.com/dotnet/announcements/issues/20)
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true

USER $APP_UID
USER app
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ ENV \
# Set the invariant mode since ICU package isn't included (see https://github.com/dotnet/announcements/issues/20)
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true

USER $APP_UID
USER app
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ ENV \
# Set the invariant mode since ICU package isn't included (see https://github.com/dotnet/announcements/issues/20)
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true

USER $APP_UID
USER app
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ ENV \
# Set the invariant mode since ICU package isn't included (see https://github.com/dotnet/announcements/issues/20)
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true

USER $APP_UID
USER app
9 changes: 8 additions & 1 deletion tests/Microsoft.DotNet.Docker.Tests/ProductImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ protected void VerifyCommonDefaultUser(ProductImageData imageData)
string expectedUser;
if (imageData.IsDistroless && ImageType != DotNetImageType.SDK)
{
expectedUser = "app";
if (imageData.OS.Contains("cbl-mariner"))
{
expectedUser = "app";
}
else
{
expectedUser = imageData.NonRootUID.ToString();
}
}
// For Windows, only Nano Server defines a user, which seems wrong.
// I've logged https://dev.azure.com/microsoft/OS/_workitems/edit/40146885 for this.
Expand Down

0 comments on commit 2d48ef9

Please sign in to comment.