on master help sign in
Change the type of entrypoint to [Text]
f73e3baKwang Yul Seo
src/Docker/Client/Types.hs+6−4
@@ -93,6 +93,7 @@ import Data.Aeson (FromJSON, ToJSON, genericParseJSON,
93import qualified Data.Aeson as JSON
93import qualified Data.Aeson as JSON
94import Data.Aeson.Types (defaultOptions, fieldLabelModifier)
94import Data.Aeson.Types (defaultOptions, fieldLabelModifier)
95import Data.Char (isAlphaNum, toUpper)
95import Data.Char (isAlphaNum, toUpper)
96+import Data.Foldable (asum)
96import qualified Data.HashMap.Strict as HM
97import qualified Data.HashMap.Strict as HM
97import Data.Monoid ((<>))
98import Data.Monoid ((<>))
98import Data.Scientific (floatingOrInteger)
99import Data.Scientific (floatingOrInteger)
@@ -623,7 +624,7 @@ defaultContainerConfig imageName = ContainerConfig {
623 , cmd=[]
624 , cmd=[]
624 , volumes=[]
625 , volumes=[]
625 , workingDir=Nothing
626 , workingDir=Nothing
626− , entrypoint=Nothing
627+ , entrypoint=[]
627 , networkDisabled=Nothing
628 , networkDisabled=Nothing
628 , macAddress=Nothing
629 , macAddress=Nothing
629 , labels=[]
630 , labels=[]
@@ -1362,7 +1363,7 @@ data ContainerConfig = ContainerConfig {
1362 , image :: Text
1363 , image :: Text
1363 , volumes :: [Volume]
1364 , volumes :: [Volume]
1364 , workingDir :: Maybe FilePath
1365 , workingDir :: Maybe FilePath
1365− , entrypoint :: Maybe Text -- Can be null?
1366+ , entrypoint :: [Text]
1366 , networkDisabled :: Maybe Bool -- Note: Should we expand the JSON instance and take away the Maybe? Null is False?
1367 , networkDisabled :: Maybe Bool -- Note: Should we expand the JSON instance and take away the Maybe? Null is False?
1367 , macAddress :: Maybe Text
1368 , macAddress :: Maybe Text
1368 -- , onBuild :: Maybe Text -- For 1.24, only see this in the inspect response.
1369 -- , onBuild :: Maybe Text -- For 1.24, only see this in the inspect response.
@@ -1391,7 +1392,9 @@ instance FromJSON ContainerConfig where
1391 image <- o .: "Image"
1392 image <- o .: "Image"
1392 volumes <- o .: "Volumes"
1393 volumes <- o .: "Volumes"
1393 workingDir <- o .:? "WorkingDir"
1394 workingDir <- o .:? "WorkingDir"
1394− entrypoint <- o .:? "Entrypoint"
1395+ entrypoint <- asum [ o .:? "Entrypoint" .!= []
1396+ , (:[]) <$> o .: "Entrypoint"
1397+ ]
1395 networkDisabled <- o .:? "networkDisabled"
1398 networkDisabled <- o .:? "networkDisabled"
1396 macAddress <- o .:? "MacAddress"
1399 macAddress <- o .:? "MacAddress"
1397 labels <- o .:? "Labels" .!= []
1400 labels <- o .:? "Labels" .!= []
@@ -1422,4 +1425,3 @@ toJsonKeyVal vs getKey getVal = JSON.Object $ foldl f HM.empty vs
1422-- | Helper function that return an empty dictionary "{}"
1425-- | Helper function that return an empty dictionary "{}"
1423emptyJsonObject :: JSON.Value
1426emptyJsonObject :: JSON.Value
1424emptyJsonObject = JSON.Object HM.empty
1427emptyJsonObject = JSON.Object HM.empty
1425−