1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/fogdocker/requests/compute/container_create.rb
2014-02-16 01:06:49 +02:00

53 lines
1.4 KiB
Ruby

module Fog
module Compute
class Fogdocker
# Create attributes
#'Hostname' => '',
#'User' => '',
#'Memory' => 0,
#'MemorySwap' => 0,
#'AttachStdin' => false,
#'AttachStdout' => true,
#'AttachStderr' => true,
#'PortSpecs' => nil,
#'Tty' => false,
#'OpenStdin' => false,
#'StdinOnce' => false,
#'Env' => nil,
#'Cmd' => ['date'],
#'Dns' => nil,
#'Image' => 'base',
#'Volumes' => {
# '/tmp' => {}
#},
#'VolumesFrom' => '',
#'WorkingDir' => '',
#'ExposedPorts' => {
# '22/tcp' => {}
#}
class Real
def container_create(attrs)
downcase_hash_keys Docker::Container.create(attrs).info
end
end
class Mock
def container_create(attrs)
{'id' => '2ce79789656e4f7474624be6496dc6d988899af30d556574389a19aade2f9650',
'image' => 'mattdm/fedora:f19',
'command' => '/bin/bash',
'created' => '1389876158',
'status' => 'Up 45 hours',
'state' => {'running' => 'true'},
'ports' => nil,
'sizerw' => 0,
'sizerootfs' => 0,
'name' => '123123123',
'names' => ['/boring_engelbert']
}
end
end
end
end
end