RemoteDockers v1.3.3 RemoteDockers.ContainerConfig View Source
Link to this section Summary
Functions
Add an environment variable to the specified container configuration
Add a volume mount point description to the container host configuration
Add a volume mount point binding (i.e. mount type is bind
) to the container configuration
Build a container configuration with a specified image_name
Link to this section Functions
Add an environment variable to the specified container configuration.
Example:
iex> ContainerConfig.new("hello-world")
...> |> ContainerConfig.add_env("TOTO", "/path/to/toto")
%ContainerConfig{
:Image => "hello-world",
:Env => ["TOTO=/path/to/toto"],
:HostConfig => %{}
}
Link to this function
add_mount_point(container_config, mount_point)
View Source
add_mount_point(RemoteDockers.ContainerConfig, RemoteDockers.MountPoint) :: RemoteDockers.ContainerConfig
Add a volume mount point description to the container host configuration.
Example:
mount_point = %{
"Source": "/path/to/host/mount/point",
"Target": "/path/to/container/directory",
"Type": "bind"
}
ContainerConfig.new("MyImage")
|> ContainerConfig.add(mount_point)
Add a volume mount point binding (i.e. mount type is bind
) to the container configuration.
source
and target
values are respectively mapped to the "Source"
and "Target"
mount point
description fields.
Example:
iex> ContainerConfig.new("image_name")
...> |> ContainerConfig.add_mount_point("/path/to/a/host/mount/point", "/path/to/a/container/directory")
...> |> ContainerConfig.add_mount_point("/path/to/another/host/mount/point", "/path/to/another/container/directory")
%ContainerConfig{
:Image => "image_name",
:Env => [],
:HostConfig => %{
:Mounts => [
%MountPoint{
:Source => "/path/to/a/host/mount/point",
:Target => "/path/to/a/container/directory",
:Type => "bind"
},
%MountPoint{
:Source => "/path/to/another/host/mount/point",
:Target => "/path/to/another/container/directory",
:Type => "bind"
}
]
}
}