Skip to content

Commit fb59b7f

Browse files
committed
Use different find arg per os
1 parent bfe05d5 commit fb59b7f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,16 @@ private IEnumerable<SdkContentFileInfo> GetActualSdkContents(ProductImageData im
234234
{
235235
dotnetPath = "/usr/share/dotnet";
236236
destinationPath = "/sdk";
237-
command = $"find {destinationPath} -type f -o -type l -exec sha512sum {{}} +";
237+
238+
// Alpine has limited find syntax support
239+
if (imageData.SdkOS.Family == OSFamily.Alpine)
240+
{
241+
command = $"find {destinationPath} \\( -type f -o -type l \\) -exec sha512sum {{}} +";
242+
}
243+
else
244+
{
245+
command = $"find {destinationPath} -type f,l -exec sha512sum {{}} +";
246+
}
238247
}
239248
else
240249
{

0 commit comments

Comments
 (0)