Skip to content
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
4 changes: 2 additions & 2 deletions Testcontainers.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<Project Path="src/Testcontainers.Seq/Testcontainers.Seq.csproj"/>
<Project Path="src/Testcontainers.ServiceBus/Testcontainers.ServiceBus.csproj"/>
<Project Path="src/Testcontainers.Sftp/Testcontainers.Sftp.csproj"/>
<Project Path="src/Testcontainers.Temporalio/Testcontainers.Temporalio.csproj"/>
<Project Path="src/Testcontainers.Temporal/Testcontainers.Temporal.csproj"/>
Comment thread
HofmeisterAn marked this conversation as resolved.
<Project Path="src/Testcontainers.Toxiproxy/Testcontainers.Toxiproxy.csproj"/>
<Project Path="src/Testcontainers.Typesense/Testcontainers.Typesense.csproj"/>
<Project Path="src/Testcontainers.Weaviate/Testcontainers.Weaviate.csproj"/>
Expand Down Expand Up @@ -139,7 +139,7 @@
<Project Path="tests/Testcontainers.Seq.Tests/Testcontainers.Seq.Tests.csproj"/>
<Project Path="tests/Testcontainers.ServiceBus.Tests/Testcontainers.ServiceBus.Tests.csproj"/>
<Project Path="tests/Testcontainers.Sftp.Tests/Testcontainers.Sftp.Tests.csproj"/>
<Project Path="tests/Testcontainers.Temporalio.Tests/Testcontainers.Temporalio.Tests.csproj"/>
<Project Path="tests/Testcontainers.Temporal.Tests/Testcontainers.Temporal.Tests.csproj"/>
<Project Path="tests/Testcontainers.Tests/Testcontainers.Tests.csproj"/>
<Project Path="tests/Testcontainers.Toxiproxy.Tests/Testcontainers.Toxiproxy.Tests.csproj"/>
<Project Path="tests/Testcontainers.Typesense.Tests/Testcontainers.Typesense.Tests.csproj"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Testcontainers/Containers/TarOutputMemoryStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public TarOutputMemoryStream(string targetDirectoryPath, ILogger logger)
/// </summary>
/// <param name="logger">The logger.</param>
public TarOutputMemoryStream(ILogger logger)
: base(new MemoryStream(), Encoding.Default)
: base(new MemoryStream(), TarArchiveDefaults.TarBlockFactor, Encoding.Default)
{
_logger = logger;
IsStreamOwner = false;
Expand Down
4 changes: 2 additions & 2 deletions src/Testcontainers/Images/DockerfileArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace DotNet.Testcontainers.Images
using System.Threading.Tasks;
using DotNet.Testcontainers.Configurations;
using ICSharpCode.SharpZipLib.Tar;
using Microsoft.Extensions.Logging;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;

/// <summary>
/// Generates a tar archive with Docker configuration files. The tar archive can be used to build a Docker image.
Expand Down Expand Up @@ -192,7 +192,7 @@ public async Task<string> Tar(CancellationToken ct = default)

using (var tarOutputFileStream = new FileStream(dockerfileArchiveFilePath, FileMode.Create, FileAccess.Write))
{
using (var tarOutputStream = new TarOutputStream(tarOutputFileStream, Encoding.Default))
using (var tarOutputStream = new TarOutputStream(tarOutputFileStream, TarArchiveDefaults.TarBlockFactor, Encoding.Default))
{
tarOutputStream.IsStreamOwner = false;

Expand Down
14 changes: 14 additions & 0 deletions src/Testcontainers/TarArchiveDefaults.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace DotNet.Testcontainers
{
internal static class TarArchiveDefaults
{
// Keep the record size equal to the block size (512 B) so SharpZipLib does
// not write extra zero padding beyond the two standard EOF blocks. The
// default factor of 20 produces ~8 KB of zeros after EOF, which can trigger
// a race in Podman's archive handler. The tar subprocess exits after the EOF
// blocks while the HTTP sender is still flushing the padding, causing EPIPE
// (HTTP 500 "broken pipe"). See:
// https://github.com/testcontainers/testcontainers-dotnet/issues/1683.
internal const int TarBlockFactor = 1;
}
}
Loading