@@ -624,9 +624,12 @@ instance ToJSON EndpointConfig where
624624 [ "Aliases" .= aliases
625625 ]
626626
627+-- | Alias for endpoint name
628+type EndpointName = Text
629+
627630-- | Data type for the NetworkingConfig section of the container settings
628631newtype NetworkingConfig = NetworkingConfig
629− { endpointsConfig :: HM.HashMap Text EndpointConfig
632+ { endpointsConfig :: HM.HashMap EndpointName EndpointConfig
630633 } deriving (Eq, Show)
631634
632635instance ToJSON NetworkingConfig where
@@ -636,9 +639,9 @@ instance ToJSON NetworkingConfig where
636639
637640-- | Options used for creating a Container.
638641data CreateOpts = CreateOpts {
639− containerConfig :: ContainerConfig
640− , hostConfig :: HostConfig
641− , networkingConfig :: Maybe NetworkingConfig
642+ containerConfig :: ContainerConfig
643+ , hostConfig :: HostConfig
644+ , networkingConfig :: NetworkingConfig
642645 } deriving (Eq, Show)
643646
644647instance ToJSON CreateOpts where
@@ -648,9 +651,7 @@ instance ToJSON CreateOpts where
648651 case ccJSON of
649652 JSON.Object (o :: HM.HashMap T.Text JSON.Value) -> do
650653 let o1 = HM.insert "HostConfig" hcJSON o
651− let o2 = case nc of
652− Nothing -> o1
653− Just _ -> HM.insert "NetworkingConfig" (toJSON nc) o1
654+ let o2 = HM.insert "NetworkingConfig" (toJSON nc) o1
654655 JSON.Object o2
655656 _ -> error "ContainerConfig is not an object." -- This should never happen.
656657
@@ -736,7 +737,7 @@ defaultCreateOpts :: T.Text -> CreateOpts
736737defaultCreateOpts imageName = CreateOpts
737738 { containerConfig = defaultContainerConfig imageName
738739 , hostConfig = defaultHostConfig
739− , networkingConfig = Nothing
740+ , networkingConfig = NetworkingConfig HM.empty
740741 }
741742
742743-- | Override the key sequence for detaching a container.