Skip to content

Commit

Permalink
Ensure tar installed in SDK for Mariner 2.0 (dotnet#4065)
Browse files Browse the repository at this point in the history
(cherry picked from commit 676db0d)
  • Loading branch information
mthalman committed Sep 12, 2022
1 parent b537e33 commit 831434a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eng/dockerfile-templates/sdk/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
when(isMariner,
[
"git",
when(dotnetVersion = "3.1", "procps-ng", "")
when(dotnetVersion = "3.1", "procps-ng", ""),
when(find(OS_VERSION, "1.0") < 0 && dotnetVersion = "6.0", "tar", "")
],
[
"curl",
Expand Down
1 change: 1 addition & 0 deletions src/sdk/6.0/cbl-mariner2.0/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ENV \

RUN tdnf install -y \
git \
tar \
&& tdnf clean all

# Install .NET SDK
Expand Down
1 change: 1 addition & 0 deletions src/sdk/6.0/cbl-mariner2.0/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ENV \

RUN tdnf install -y \
git \
tar \
&& tdnf clean all

# Install .NET SDK
Expand Down
18 changes: 18 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,24 @@ public void VerifyGitInstallation(ProductImageData imageData)
);
}

/// <summary>
/// Verifies that a tar command can be executed without failure.
/// </summary>
[DotNetTheory]
[MemberData(nameof(GetImageData))]
public void VerifyTarInstallation(ProductImageData imageData)
{
if (imageData.Version.Major != 7)
{
// tar should exist in the SDK for both Linux and Windows. The --version option works in either OS
DockerHelper.Run(
image: imageData.GetImage(DotNetImageType.SDK, DockerHelper),
name: imageData.GetIdentifier("tar"),
command: "tar --version"
);
}
}

private IEnumerable<SdkContentFileInfo> GetActualSdkContents(ProductImageData imageData)
{
string dotnetPath;
Expand Down

0 comments on commit 831434a

Please sign in to comment.