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