RemoteDockers v1.3.10 RemoteDockers.ContainerConfig View Source
Link to this section Summary
Functions
Add a DNS option to the container configuration
Add an environment variable to the specified container configuration
Add an extra Host to the 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
Add parameter to the HostConfig element
Link to this section Functions
add_dns_option(RemoteDockers.ContainerConfig, bitstring()) :: RemoteDockers.ContainerConfig
Add a DNS option to the container configuration.
See add_dns_option/2
Example:
iex> ContainerConfig.new("image_name")
...> |> ContainerConfig.add_dns_option("dns option")
%ContainerConfig{
:Image => "image_name",
:Env => [],
:HostConfig => %{
:DnsOptions => ["dns option"],
}
}
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 => %{},
}
Add an extra Host to the container configuration.
See add_extra_host/3
Example:
iex> ContainerConfig.new("image_name")
...> |> ContainerConfig.add_extra_host("my_host", "192.168.10.10")
%ContainerConfig{
:Image => "image_name",
:Env => [],
:HostConfig => %{
:ExtraHosts => ["my_host:192.168.10.10"],
}
}
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"
}
]
}
}
Build a container configuration with a specified image_name
.
Example:
iex> ContainerConfig.new("hello-world")
%ContainerConfig{
:Image => "hello-world",
:Env => [],
:HostConfig => %{}
}
Add parameter to the HostConfig element.
Example:
iex> ContainerConfig.new("image_name")
...> |> ContainerConfig.update_host_config(:my_custom_key, :my_custom_value)
%ContainerConfig{
:Image => "image_name",
:Env => [],
:HostConfig => %{
:my_custom_key => :my_custom_value,
}
}