DockerConfig
Category: Shell
Source: docker_config.dart
Enums
MountMode
| Value | Description |
|---|---|
ro | |
rw |
Classes
MountEntry
Constructor
dart
MountEntry({
required this.hostPath,
this.mode = MountMode.rw,
this.containerPath,
this.addedAt,
})dart
factory MountEntry.parse(String spec)Parses a Docker-style mount spec into a [MountEntry].
The format mirrors Docker's -v syntax for familiarity:
/host/path → rw, same container path
/host/path:/container/path → rw, explicit container path
/host/path:ro → read-only, same container path
/host/path:/container/path:ro → read-only, explicit container pathThrows [ArgumentError] if the spec is empty or the host path isn't absolute.
dart
factory MountEntry.fromJson(Map<String, dynamic> json)Properties
| Property | Type | Description |
|---|---|---|
hostPath | String | |
mode | MountMode | |
containerPath | String? | Where to mount this path inside the container. When null, the [hostPath] is used as the container path too, so /home/me/project mounts at /home/me/project inside the container. |
addedAt | DateTime? |
Methods
String toDockerArg()
Formats this entry as a Docker -v volume argument.
dart
MountEntry(hostPath: '/src', mode: MountMode.ro).toDockerArg()
// => '/src:/src:ro'static List<MountEntry> dedup(List<MountEntry> entries)
Removes duplicate mounts, keeping the last entry for each unique path/mode combo.
Applied before building Docker args so that config-level mounts and session-level mounts can overlap without producing duplicate -v flags.
DockerConfig
Constructor
dart
const DockerConfig({
this.enabled = false,
this.image = 'ubuntu:24.04',
this.shell = 'sh',
this.fallbackToHost = true,
this.mounts = const [],
})Properties
| Property | Type | Description |
|---|---|---|
enabled | bool | |
image | String | |
shell | String | |
fallbackToHost | bool | |
mounts | List<MountEntry> |