DockerDotNet.Presets
1.3.0
dotnet add package DockerDotNet.Presets --version 1.3.0
NuGet\Install-Package DockerDotNet.Presets -Version 1.3.0
<PackageReference Include="DockerDotNet.Presets" Version="1.3.0" />
<PackageVersion Include="DockerDotNet.Presets" Version="1.3.0" />
<PackageReference Include="DockerDotNet.Presets" />
paket add DockerDotNet.Presets --version 1.3.0
#r "nuget: DockerDotNet.Presets, 1.3.0"
#:package DockerDotNet.Presets@1.3.0
#addin nuget:?package=DockerDotNet.Presets&version=1.3.0
#tool nuget:?package=DockerDotNet.Presets&version=1.3.0
DockerDotNet.Presets
This library is made to speed up and simplify the working experience with docker containers. It is made up on Docker.DotNet that is a really great library that exposes good api to interact with docker, but it could be a bit verbose and long to bring up containers, for this reason I built this library with a set of ready configurations to run up containers.
Installation
You can add this library to your project using NuGet.
Package Manager Console Run the following command in the “Package Manager Console”:
PM> Install-Package DockerDotNet.Presets
.NET Core Command Line Interface Run the following command from your favorite shell or terminal:
dotnet add package DockerDotNet.Presets
Usage
Create a container from a preset configuration:
using DockerDotNet.Presets;
using DockerDotNet.Presets.Configurations.Postgres;
using DockerDotNet.Presets.DTO;
DockerContainerResult containerResult = await DockerContainerGenerator.CreateContainerAsync(
new PostgresContainerConfiguration(
"DB_NAME",
"DB_USER",
"DB_PASSWORD",
"postgres_container_name",
"postgres_test_volume",
"latest",
5432
)
).ConfigureAwait(false);
Drop a container by container id:
using DockerDotNet.Presets;
await DockerContainerGenerator.DropContainerById(_containerId)
.ConfigureAwait(false);
Find a container by container id or container name:
using Docker.DotNet.Models;
using DockerDotNet.Presets;
using DockerDotNet.Presets.DTO;
ContainerListResponse? result = await DockerContainerGenerator.FindContainerAsync(
GetDockerContainerRequest.CreateByContainerId(
_containerId
)
).ConfigureAwait(false);
If you need to create a container that is not present in this configurations you can create your own (and if it useful improve configurations of this repo) by extending abstract class: ContainerConfiguration
License
DockerDotNet.Presets is licensed under the MIT license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Docker.DotNet (>= 3.125.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.