Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure tar installed in SDK for Mariner 2.0 #4065

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, "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
1 change: 1 addition & 0 deletions src/sdk/7.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/7.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
15 changes: 15 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,21 @@ 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)
{
// 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