Topwater.Containers 0.1.0-preview.9

This is a prerelease version of Topwater.Containers.
dotnet add package Topwater.Containers --version 0.1.0-preview.9
                    
NuGet\Install-Package Topwater.Containers -Version 0.1.0-preview.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Topwater.Containers" Version="0.1.0-preview.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Topwater.Containers" Version="0.1.0-preview.9" />
                    
Directory.Packages.props
<PackageReference Include="Topwater.Containers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Topwater.Containers --version 0.1.0-preview.9
                    
#r "nuget: Topwater.Containers, 0.1.0-preview.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Topwater.Containers@0.1.0-preview.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Topwater.Containers&version=0.1.0-preview.9&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Topwater.Containers&version=0.1.0-preview.9&prerelease
                    
Install as a Cake Tool

Topwater.Containers

Move a Topwater machine into a real Docker container and back. Build an image from a snapshot to give an agent real programs (python, git, compilers) on the same files, user, working directory and environment. Or import a container as a snapshot, so an agent can investigate a copy of a real machine in the simulation, where it can be forked and rewound.

dotnet add package Topwater.Containers --prerelease

Snapshot to container:

using Topwater;
using Topwater.Containers;

var context = await shell.Snapshot().BuildImageAsync("my-agent");
Console.WriteLine(context.Report);   // what didn't carry over
docker run -it my-agent

Container to snapshot:

var result = await ContainerImport.FromContainerAsync("web-1", new ContainerImportOptions { Paths = ["/var/log", "/etc"] });
var shell = new Shell(new ShellOptions { User = result.Snapshot.User });
shell.Restore(result.Snapshot);

Files (content, mode, owner, modification time to the second), the user, the working directory, exported variables and history carry over. Other variables, functions, aliases and options go into an image, and come back from images Topwater made. Left behind, and listed in the Report: registered commands, the host name, per-process state, Topwater's limits, groups, and for an import, real processes, volumes and (unless you name them in Paths) the image's unchanged files.

These are host APIs. Nothing here registers a command, so the agent can never trigger an export, a build or an import. Container content is untrusted: paths must be canonical, the import is bounded by MaxFileSystemBytes, MaxStringBytes and MaxExtractEntries, nothing is written to disk, and the result goes through the same checks as ShellSnapshot.Load.

An exported image holds what the agent wrote: its files and scripts, its ~/.bashrc and the session script that ~/.bashrc sources, file modes and owners. Starting a shell in it runs that content. Treat the image as untrusted, and run it with the same care, limits and isolation you would give the agent itself. See Containers.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.9 0 11/30/2026
0.1.0-preview.8 46 11/29/2026
0.1.0-preview.7 70 11/28/2026
0.1.0-preview.6 62 11/28/2026
0.1.0-preview.5 80 11/27/2026
0.1.0-preview.4 51 11/26/2026
0.1.0-preview.3 53 11/26/2026
0.1.0-preview.2 52 11/25/2026