Skip to content

feat: Add docker compose support (#122) #1082

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

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<PackageVersion Include="Azure.Storage.Blobs" Version="12.17.0"/>
<PackageVersion Include="Azure.Storage.Queues" Version="12.15.0"/>
<PackageVersion Include="ClickHouse.Client" Version="6.7.1"/>
<PackageVersion Include="CliWrap" Version="3.6.4"/>
<PackageVersion Include="Confluent.Kafka" Version="2.0.2"/>
<PackageVersion Include="Consul" Version="1.6.10.9"/>
<PackageVersion Include="CouchbaseNetClient" Version="3.4.3"/>
Expand Down
14 changes: 14 additions & 0 deletions Testcontainers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Couchbase",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CouchDb", "src\Testcontainers.CouchDb\Testcontainers.CouchDb.csproj", "{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DockerCompose", "src\Testcontainers.DockerCompose\Testcontainers.DockerCompose.csproj", "{5CF21353-F3DB-4993-B9D8-DFAA8B2C4D2F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DynamoDb", "src\Testcontainers.DynamoDb\Testcontainers.DynamoDb.csproj", "{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearch", "src\Testcontainers.Elasticsearch\Testcontainers.Elasticsearch.csproj", "{641DDEA5-B6E0-41E6-BA11-7A28C0913127}"
Expand Down Expand Up @@ -125,6 +127,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CouchDb.Test
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Databases.Tests", "tests\Testcontainers.Databases.Tests\Testcontainers.Databases.Tests.csproj", "{DA54916E-1128-4200-B6AE-9F5BF02D832D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DockerCompose.Tests", "tests\Testcontainers.DockerCompose.Tests\Testcontainers.DockerCompose.Tests.csproj", "{D77017F1-9E38-4B06-8CEB-9B3D98B6497C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DynamoDb.Tests", "tests\Testcontainers.DynamoDb.Tests\Testcontainers.DynamoDb.Tests.csproj", "{101515E6-74C1-40F9-85C8-871F742A378D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearch.Tests", "tests\Testcontainers.Elasticsearch.Tests\Testcontainers.Elasticsearch.Tests.csproj", "{DD5B3678-468F-4D73-AECE-705E3D66CD43}"
Expand Down Expand Up @@ -248,6 +252,10 @@ Global
{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}.Release|Any CPU.Build.0 = Release|Any CPU
{5CF21353-F3DB-4993-B9D8-DFAA8B2C4D2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CF21353-F3DB-4993-B9D8-DFAA8B2C4D2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CF21353-F3DB-4993-B9D8-DFAA8B2C4D2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CF21353-F3DB-4993-B9D8-DFAA8B2C4D2F}.Release|Any CPU.Build.0 = Release|Any CPU
{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -428,6 +436,10 @@ Global
{DA54916E-1128-4200-B6AE-9F5BF02D832D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA54916E-1128-4200-B6AE-9F5BF02D832D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA54916E-1128-4200-B6AE-9F5BF02D832D}.Release|Any CPU.Build.0 = Release|Any CPU
{D77017F1-9E38-4B06-8CEB-9B3D98B6497C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D77017F1-9E38-4B06-8CEB-9B3D98B6497C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D77017F1-9E38-4B06-8CEB-9B3D98B6497C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D77017F1-9E38-4B06-8CEB-9B3D98B6497C}.Release|Any CPU.Build.0 = Release|Any CPU
{101515E6-74C1-40F9-85C8-871F742A378D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{101515E6-74C1-40F9-85C8-871F742A378D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{101515E6-74C1-40F9-85C8-871F742A378D}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -581,6 +593,7 @@ Global
{A724806F-8C94-4438-8011-04A9A1575318} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{58E94721-2681-4D82-8D94-0B2F9DB0D575} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{5CF21353-F3DB-4993-B9D8-DFAA8B2C4D2F} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{641DDEA5-B6E0-41E6-BA11-7A28C0913127} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{84D707E0-C9FA-4327-85DC-0AFEBEA73572} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
Expand Down Expand Up @@ -626,6 +639,7 @@ Global
{809322BA-D690-4F2B-B884-23F895663963} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{E4520FB1-4466-4DCA-AD08-4075102C68D3} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{DA54916E-1128-4200-B6AE-9F5BF02D832D} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{D77017F1-9E38-4B06-8CEB-9B3D98B6497C} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{101515E6-74C1-40F9-85C8-871F742A378D} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{DD5B3678-468F-4D73-AECE-705E3D66CD43} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
Expand Down
1 change: 1 addition & 0 deletions src/Testcontainers.DockerCompose/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root = true
114 changes: 114 additions & 0 deletions src/Testcontainers.DockerCompose/DockerComposeBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
namespace Testcontainers.DockerCompose;

/// <inheritdoc cref="ContainerBuilder{TBuilderEntity, TContainerEntity, TConfigurationEntity}" />
[PublicAPI]
public sealed class DockerComposeBuilder : ContainerBuilder<DockerComposeBuilder, DockerComposeContainer, DockerComposeConfiguration>
{
public const string DockerComposeFilePath = "/docker-compose.yml";

public const string DockerComposeImage = "docker:25.0-cli";

// TODO: This does not support all container runtimes (host configurations). We should do something similar to what we are doing in the Resource Reaper implementation.
private const string DockerSocketPath = "/var/run/docker.sock";

/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeBuilder" /> class.
/// </summary>
public DockerComposeBuilder()
: this(new DockerComposeConfiguration())
{
DockerResourceConfiguration = Init().DockerResourceConfiguration;
}

/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeBuilder" /> class.
/// </summary>
/// <param name="resourceConfiguration">The Docker resource configuration.</param>
private DockerComposeBuilder(DockerComposeConfiguration resourceConfiguration)
: base(resourceConfiguration)
{
DockerResourceConfiguration = resourceConfiguration;
}

/// <inheritdoc />
protected override DockerComposeConfiguration DockerResourceConfiguration { get; }

/// <summary>
/// Sets the Docker Compose file.
/// </summary>
/// <param name="composeFilePath">The Docker Compose file path.</param>
/// <returns>A configured instance of <see cref="DockerComposeBuilder" />.</returns>
public DockerComposeBuilder WithComposeFile(string composeFilePath)
{
return Merge(DockerResourceConfiguration, new DockerComposeConfiguration(composeFilePath: composeFilePath))
.WithEntrypoint("docker", "compose", "--project-name", Guid.NewGuid().ToString("D"), "--file", composeFilePath)
.WithResourceMapping(new FileInfo(composeFilePath), new FileInfo(DockerComposeFilePath));
}

/// <summary>
/// Sets the Docker Compose mode.
/// </summary>
/// <param name="mode">The Docker Compose mode.</param>
/// <returns>A configured instance of <see cref="DockerComposeBuilder" />.</returns>
public DockerComposeBuilder WithComposeMode(DockerComposeMode mode)
{
return Merge(DockerResourceConfiguration, new DockerComposeConfiguration(mode: mode));
}

/// <inheritdoc />
public override DockerComposeContainer Build()
{
Validate();

switch (DockerResourceConfiguration.Mode)
{
case DockerComposeMode.Local:
return new DockerComposeLocalContainer(DockerResourceConfiguration, TestcontainersSettings.Logger);

Check failure on line 66 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 66 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 66 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 66 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 66 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 66 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'TestcontainersSettings' does not contain a definition for 'Logger'
case DockerComposeMode.Remote:
return new DockerComposeRemoteContainer(DockerResourceConfiguration, TestcontainersSettings.Logger);

Check failure on line 68 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 68 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 68 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 68 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 68 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'TestcontainersSettings' does not contain a definition for 'Logger'

Check failure on line 68 in src/Testcontainers.DockerCompose/DockerComposeBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'TestcontainersSettings' does not contain a definition for 'Logger'
default:
throw new ArgumentOutOfRangeException(nameof(DockerResourceConfiguration.Mode), "Docker Compose mode not supported.");
}
}

/// <inheritdoc />
protected override DockerComposeBuilder Init()
{
return base.Init()
.WithImage(DockerComposeImage)
.WithCommand("up")
.WithCommand("--detach")
.WithComposeMode(DockerComposeMode.Remote)
.WithBindMount(DockerSocketPath, DockerSocketPath, AccessMode.ReadOnly);
}

/// <inheritdoc />
protected override void Validate()
{
base.Validate();

const string dockerComposeFileNotFound = "Docker Compose file not found.";
_ = Guard.Argument(DockerResourceConfiguration.ComposeFilePath, nameof(DockerComposeConfiguration.ComposeFilePath))
.NotNull()
.NotEmpty()
.ThrowIf(argument => !File.Exists(argument.Value), argument => new FileNotFoundException(dockerComposeFileNotFound, argument.Value));
}

/// <inheritdoc />
protected override DockerComposeBuilder Clone(IResourceConfiguration<CreateContainerParameters> resourceConfiguration)
{
return Merge(DockerResourceConfiguration, new DockerComposeConfiguration(resourceConfiguration));
}

/// <inheritdoc />
protected override DockerComposeBuilder Clone(IContainerConfiguration resourceConfiguration)
{
return Merge(DockerResourceConfiguration, new DockerComposeConfiguration(resourceConfiguration));
}

/// <inheritdoc />
protected override DockerComposeBuilder Merge(DockerComposeConfiguration oldValue, DockerComposeConfiguration newValue)
{
return new DockerComposeBuilder(new DockerComposeConfiguration(oldValue, newValue));
}
}
71 changes: 71 additions & 0 deletions src/Testcontainers.DockerCompose/DockerComposeConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
namespace Testcontainers.DockerCompose;

/// <inheritdoc cref="ContainerConfiguration" />
[PublicAPI]
public sealed class DockerComposeConfiguration : ContainerConfiguration
{
/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeConfiguration" /> class.
/// </summary>
/// <param name="composeFilePath">The Docker Compose file path.</param>
/// <param name="mode">The Docker Compose mode.</param>
public DockerComposeConfiguration(
string composeFilePath = null,
DockerComposeMode? mode = null)
{
ComposeFilePath = composeFilePath;
Mode = mode;
}

/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeConfiguration" /> class.
/// </summary>
/// <param name="resourceConfiguration">The Docker resource configuration.</param>
public DockerComposeConfiguration(IResourceConfiguration<CreateContainerParameters> resourceConfiguration)
: base(resourceConfiguration)
{
// Passes the configuration upwards to the base implementations to create an updated immutable copy.
}

/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeConfiguration" /> class.
/// </summary>
/// <param name="resourceConfiguration">The Docker resource configuration.</param>
public DockerComposeConfiguration(IContainerConfiguration resourceConfiguration)
: base(resourceConfiguration)
{
// Passes the configuration upwards to the base implementations to create an updated immutable copy.
}

/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeConfiguration" /> class.
/// </summary>
/// <param name="resourceConfiguration">The Docker resource configuration.</param>
public DockerComposeConfiguration(DockerComposeConfiguration resourceConfiguration)
: this(new DockerComposeConfiguration(), resourceConfiguration)
{
// Passes the configuration upwards to the base implementations to create an updated immutable copy.
}

/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeConfiguration" /> class.
/// </summary>
/// <param name="oldValue">The old Docker resource configuration.</param>
/// <param name="newValue">The new Docker resource configuration.</param>
public DockerComposeConfiguration(DockerComposeConfiguration oldValue, DockerComposeConfiguration newValue)
: base(oldValue, newValue)
{
ComposeFilePath = BuildConfiguration.Combine(oldValue.ComposeFilePath, newValue.ComposeFilePath);
Mode = BuildConfiguration.Combine(oldValue.Mode, newValue.Mode);
}

/// <summary>
/// Gets the Docker Compose file path.
/// </summary>
public string ComposeFilePath { get; }

/// <summary>
/// Gets the Docker Compose mode.
/// </summary>
public DockerComposeMode? Mode { get; }
}
16 changes: 16 additions & 0 deletions src/Testcontainers.DockerCompose/DockerComposeContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Testcontainers.DockerCompose;

/// <inheritdoc cref="DockerContainer" />
[PublicAPI]
public abstract class DockerComposeContainer : DockerContainer
{
/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeContainer" /> class.
/// </summary>
/// <param name="configuration">The container configuration.</param>
/// <param name="logger">The logger.</param>
protected DockerComposeContainer(DockerComposeConfiguration configuration, ILogger logger)
: base(configuration, logger)

Check failure on line 13 in src/Testcontainers.DockerCompose/DockerComposeContainer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'DockerContainer' does not contain a constructor that takes 2 arguments

Check failure on line 13 in src/Testcontainers.DockerCompose/DockerComposeContainer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'DockerContainer' does not contain a constructor that takes 2 arguments

Check failure on line 13 in src/Testcontainers.DockerCompose/DockerComposeContainer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'DockerContainer' does not contain a constructor that takes 2 arguments

Check failure on line 13 in src/Testcontainers.DockerCompose/DockerComposeContainer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04)

'DockerContainer' does not contain a constructor that takes 2 arguments

Check failure on line 13 in src/Testcontainers.DockerCompose/DockerComposeContainer.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'DockerContainer' does not contain a constructor that takes 2 arguments

Check failure on line 13 in src/Testcontainers.DockerCompose/DockerComposeContainer.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'DockerContainer' does not contain a constructor that takes 2 arguments

Check failure on line 13 in src/Testcontainers.DockerCompose/DockerComposeContainer.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'DockerContainer' does not contain a constructor that takes 2 arguments

Check failure on line 13 in src/Testcontainers.DockerCompose/DockerComposeContainer.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

'DockerContainer' does not contain a constructor that takes 2 arguments
{
}
}
42 changes: 42 additions & 0 deletions src/Testcontainers.DockerCompose/DockerComposeLocalContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
namespace Testcontainers.DockerCompose;

/// <inheritdoc cref="DockerComposeContainer" />
internal sealed class DockerComposeLocalContainer : DockerComposeContainer
{
private readonly DockerComposeConfiguration _configuration;

/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeLocalContainer" /> class.
/// </summary>
/// <param name="configuration">The container configuration.</param>
/// <param name="logger">The logger.</param>
public DockerComposeLocalContainer(DockerComposeConfiguration configuration, ILogger logger)
: base(configuration, logger)
{
_configuration = configuration;
}

/// <inheritdoc />
public override Task StartAsync(CancellationToken ct = default)
{
var workingDirectoryPath = Path.GetDirectoryName(_configuration.ComposeFilePath);

return Cli.Wrap(_configuration.Entrypoint.First())
.WithArguments(_configuration.Entrypoint.Skip(1).Concat(_configuration.Command))
.WithWorkingDirectory(workingDirectoryPath)
.WithValidation(CommandResultValidation.None)
.ExecuteBufferedAsync(ct);
}

/// <inheritdoc />
public override Task StopAsync(CancellationToken ct = default)
{
var workingDirectoryPath = Path.GetDirectoryName(_configuration.ComposeFilePath);

return Cli.Wrap(_configuration.Entrypoint.First())
.WithArguments(_configuration.Entrypoint.Skip(1).Concat(new[] { "down" }))
.WithWorkingDirectory(workingDirectoryPath)
.WithValidation(CommandResultValidation.None)
.ExecuteBufferedAsync(ct);
}
}
18 changes: 18 additions & 0 deletions src/Testcontainers.DockerCompose/DockerComposeMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Testcontainers.DockerCompose
{
/// <summary>
/// Docker Compose mode.
/// </summary>
public enum DockerComposeMode
{
/// <summary>
/// The local Docker Compose mode utilizes the Docker Compose CLI to execute the configuration.
/// </summary>
Local,

/// <summary>
/// The remote Docker Compose mode utilizes a sidecar container to execute the configuration.
/// </summary>
Remote,
}
}
15 changes: 15 additions & 0 deletions src/Testcontainers.DockerCompose/DockerComposeRemoteContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Testcontainers.DockerCompose;

/// <inheritdoc cref="DockerComposeContainer" />
internal sealed class DockerComposeRemoteContainer : DockerComposeContainer
{
/// <summary>
/// Initializes a new instance of the <see cref="DockerComposeRemoteContainer" /> class.
/// </summary>
/// <param name="configuration">The container configuration.</param>
/// <param name="logger">The logger.</param>
public DockerComposeRemoteContainer(DockerComposeConfiguration configuration, ILogger logger)
: base(configuration, logger)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" VersionOverride="2023.3.0" PrivateAssets="All"/>
<PackageReference Include="CliWrap"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Testcontainers/Testcontainers.csproj"/>
</ItemGroup>
</Project>
14 changes: 14 additions & 0 deletions src/Testcontainers.DockerCompose/Usings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
global using System;
global using System.IO;
global using System.Linq;
global using System.Threading;
global using System.Threading.Tasks;
global using CliWrap;
global using CliWrap.Buffered;
global using Docker.DotNet.Models;
global using DotNet.Testcontainers;
global using DotNet.Testcontainers.Builders;
global using DotNet.Testcontainers.Configurations;
global using DotNet.Testcontainers.Containers;
global using JetBrains.Annotations;
global using Microsoft.Extensions.Logging;
1 change: 1 addition & 0 deletions tests/Testcontainers.DockerCompose.Tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root = true
Loading
Loading