on master help sign in
amended JSON serialization of port bindings to conform to the documentation
0956dc7Humane Software
Network/Docker/Types.hs+2−2
@@ -156,7 +156,7 @@ data StartContainerOpts = StartContainerOpts
156 { _Binds :: [T.Text]
156 { _Binds :: [T.Text]
157 , _Links :: [T.Text]
157 , _Links :: [T.Text]
158 , _LxcConf :: [(T.Text, T.Text)]
158 , _LxcConf :: [(T.Text, T.Text)]
159− , _PortBindings :: [(T.Text, [(T.Text, T.Text)])]
159+ , _PortBindings :: [((Int,T.Text),Int)]
160 , _PublishAllPorts :: Bool
160 , _PublishAllPorts :: Bool
161 , _Privileged :: Bool
161 , _Privileged :: Bool
162 , _Dns :: [T.Text]
162 , _Dns :: [T.Text]
@@ -179,7 +179,7 @@ instance ToJSON StartContainerOpts where
179 [ "Binds" .= _Binds
179 [ "Binds" .= _Binds
180 , "Links" .= _Links
180 , "Links" .= _Links
181 , "LxcConf" .= _LxcConf
181 , "LxcConf" .= _LxcConf
182− , "PortBindings" .= _PortBindings
182+ , "PortBindings" .= object (map (\((h,p),c)->T.concat [T.pack (show h),"/",p] .= [object ["HostPort" .= show c]]) _PortBindings)
183 , "PublishAllPorts" .= _PublishAllPorts
183 , "PublishAllPorts" .= _PublishAllPorts
184 , "Privileged" .= _Privileged
184 , "Privileged" .= _Privileged
185 , "Dns" .= _Dns
185 , "Dns" .= _Dns