34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'app/models/container.rb', line 34
def parametrize
{ 'name' => name, 'Image' => repository_pull_url,
'Tty' => tty,
'Memory' => ::ForemanDocker::Utility.parse_memory(memory),
'Entrypoint' => entrypoint.try(:split), 'Cmd' => command.try(:split),
'AttachStdout' => attach_stdout, 'AttachStdin' => attach_stdin,
'AttachStderr' => attach_stderr, 'CpuShares' => cpu_shares,
'Cpuset' => cpu_set,
'Env' => environment_variables.map { |env| "#{env.key}=#{env.value}" },
'ExposedPorts' => Hash[*exposed_ports.map { |v| [v.key + "/" + v.value, {}] }.flatten],
'HostConfig' => {
'Dns' => dns.map { |env| "#{env.key}" }
} }
end
|