@@ -78,7 +78,7 @@ module Docker.Client.Types (
78 , DeviceWeight(..)
78 , DeviceWeight(..)
79 , DeviceRate(..)
79 , DeviceRate(..)
80 , addPortBinding
80 , addPortBinding
81− , addBinds
81+ , addBind
84import Data.Aeson (FromJSON, ToJSON, genericParseJSON,
84import Data.Aeson (FromJSON, ToJSON, genericParseJSON,
@@ -926,9 +926,12 @@ portAndType2Text :: Port -> PortType -> Text
926portAndType2Text p t = (T.pack $ show p) <> "/" <> (T.pack $ show t)
926portAndType2Text p t = (T.pack $ show p) <> "/" <> (T.pack $ show t)
929+-- | A helper function to more easily add a bind mount to existing
930+-- "CreateOpts" records.
929−addBinds :: [Bind] -> CreateOpts -> CreateOpts
931+addBind :: Bind -> CreateOpts -> CreateOpts
930−addBinds bs c = c{hostConfig=hc{binds=bs}}
932+addBind b c = c{hostConfig=hc{binds=obs <> [b]}}
931 where hc = hostConfig c
933 where hc = hostConfig c
934+ obs = binds $ hostConfig c
933-- | A convenience function that adds PortBindings to and exiting
936-- | A convenience function that adds PortBindings to and exiting
934-- "CreateOpts" record. Useful with 'defaultCreateOpts'
937-- "CreateOpts" record. Useful with 'defaultCreateOpts'