pub struct DockerConfig {
pub image: String,
pub work_dir: String,
pub setup_commands: Vec<String>,
pub environment: Vec<String>,
pub bind_mounts: Vec<String>,
pub network_disabled: bool,
pub container_name_prefix: String,
pub auto_start: bool,
pub auto_remove: bool,
}Expand description
Configuration for the Docker executor.
§Example
use adk_code::DockerConfig;
let config = DockerConfig::python();
assert_eq!(config.image, "python:3.12-slim");
assert_eq!(config.work_dir, "/workspace");Fields§
§image: StringContainer image to use.
work_dir: StringWorking directory inside the container.
setup_commands: Vec<String>Setup commands to run after container creation (e.g., pip install).
environment: Vec<String>Extra environment variables to set in the container.
bind_mounts: Vec<String>Bind mounts in host:container[:ro] format.
network_disabled: boolWhether to disable network access.
container_name_prefix: StringContainer name prefix (a random suffix is appended).
auto_start: boolWhether to auto-start on first execute if not already running.
auto_remove: boolWhether to auto-stop and remove the container on drop.
Implementations§
Source§impl DockerConfig
impl DockerConfig
Sourcepub fn setup_command(self, cmd: impl Into<String>) -> Self
pub fn setup_command(self, cmd: impl Into<String>) -> Self
Add a setup command to run after container creation.
Sourcepub fn pip_install(self, packages: &[&str]) -> Self
pub fn pip_install(self, packages: &[&str]) -> Self
Add a pip install command for Python dependencies.
Sourcepub fn npm_install(self, packages: &[&str]) -> Self
pub fn npm_install(self, packages: &[&str]) -> Self
Add an npm install command for Node.js dependencies.
Sourcepub fn with_network(self) -> Self
pub fn with_network(self) -> Self
Enable network access (disabled by default).
Sourcepub fn bind_mount(self, mount: impl Into<String>) -> Self
pub fn bind_mount(self, mount: impl Into<String>) -> Self
Add a bind mount.
Trait Implementations§
Source§impl Clone for DockerConfig
impl Clone for DockerConfig
Source§fn clone(&self) -> DockerConfig
fn clone(&self) -> DockerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DockerConfig
impl Debug for DockerConfig
Auto Trait Implementations§
impl Freeze for DockerConfig
impl RefUnwindSafe for DockerConfig
impl Send for DockerConfig
impl Sync for DockerConfig
impl Unpin for DockerConfig
impl UnsafeUnpin for DockerConfig
impl UnwindSafe for DockerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more