@@ -96,6 +96,7 @@ import Data.Aeson (FromJSON, ToJSON, genericParseJSON,
96import qualified Data.Aeson as JSON
96import qualified Data.Aeson as JSON
97import Data.Aeson.Types (defaultOptions, fieldLabelModifier)
97import Data.Aeson.Types (defaultOptions, fieldLabelModifier)
98import Data.Char (isAlphaNum, toUpper)
98import Data.Char (isAlphaNum, toUpper)
99+import Data.Foldable (asum)
99import qualified Data.HashMap.Strict as HM
100import qualified Data.HashMap.Strict as HM
100import Data.Monoid ((<>))
101import Data.Monoid ((<>))
101import Data.Scientific (floatingOrInteger)
102import Data.Scientific (floatingOrInteger)
@@ -643,7 +644,7 @@ defaultContainerConfig imageName = ContainerConfig {
644 , volumes=[]
645 , volumes=[]
645 , workingDir=Nothing
646 , workingDir=Nothing
646− , entrypoint=Nothing
647+ , entrypoint=[]
647 , networkDisabled=Nothing
648 , networkDisabled=Nothing
648 , macAddress=Nothing
649 , macAddress=Nothing
649 , labels=[]
650 , labels=[]
@@ -1404,7 +1405,7 @@ data ContainerConfig = ContainerConfig {
1404 , image :: Text
1405 , image :: Text
1405 , volumes :: [Volume]
1406 , volumes :: [Volume]
1406 , workingDir :: Maybe FilePath
1407 , workingDir :: Maybe FilePath
1407− , entrypoint :: Maybe Text -- Can be null?
1408+ , entrypoint :: [Text]
1408 , networkDisabled :: Maybe Bool -- Note: Should we expand the JSON instance and take away the Maybe? Null is False?
1409 , networkDisabled :: Maybe Bool -- Note: Should we expand the JSON instance and take away the Maybe? Null is False?
1409 , macAddress :: Maybe Text
1410 , macAddress :: Maybe Text
1410 -- , onBuild :: Maybe Text -- For 1.24, only see this in the inspect response.
1411 -- , onBuild :: Maybe Text -- For 1.24, only see this in the inspect response.
@@ -1433,7 +1434,9 @@ instance FromJSON ContainerConfig where
1433 image <- o .: "Image"
1434 image <- o .: "Image"
1434 volumes <- o .: "Volumes"
1435 volumes <- o .: "Volumes"
1435 workingDir <- o .:? "WorkingDir"
1436 workingDir <- o .:? "WorkingDir"
1436− entrypoint <- o .:? "Entrypoint"
1437+ entrypoint <- asum [ o .:? "Entrypoint" .!= []
1438+ , (:[]) <$> o .: "Entrypoint"
1437 networkDisabled <- o .:? "networkDisabled"
1440 networkDisabled <- o .:? "networkDisabled"
1438 macAddress <- o .:? "MacAddress"
1441 macAddress <- o .:? "MacAddress"
1439 labels <- o .:? "Labels" .!= []
1442 labels <- o .:? "Labels" .!= []
@@ -1464,4 +1467,3 @@ toJsonKeyVal vs getKey getVal = JSON.Object $ foldl f HM.empty vs
1464-- | Helper function that return an empty dictionary "{}"
1467-- | Helper function that return an empty dictionary "{}"
1465emptyJsonObject :: JSON.Value
1468emptyJsonObject :: JSON.Value
1466emptyJsonObject = JSON.Object HM.empty
1469emptyJsonObject = JSON.Object HM.empty