on master help sign in
A few fixups
e2bc554Deni Bertovic
Network/Docker.hs+2−2
@@ -63,8 +63,8 @@ unpauseContainer :: DockerClientOpts -> String -> IO (Status)
63unpauseContainer clientOpts cid = (^. responseStatus) <$>
63unpauseContainer clientOpts cid = (^. responseStatus) <$>
64 runDocker (unpauseContainerM clientOpts (SUnpauseContainerEndpoint cid))
64 runDocker (unpauseContainerM clientOpts (SUnpauseContainerEndpoint cid))
65
65
66−deleteContainer :: DockerClientOpts -> DeleteOpts -> String -> IO (Status)
66+deleteContainer :: DockerClientOpts -> String -> IO (Status)
67−deleteContainer c d cid = deleteContainerWithOpts c d cid
67+deleteContainer c cid = deleteContainerWithOpts c defaultDeleteOpts cid
68
68
69deleteContainerWithOpts :: DockerClientOpts -> DeleteOpts -> String -> IO (Status)
69deleteContainerWithOpts :: DockerClientOpts -> DeleteOpts -> String -> IO (Status)
70deleteContainerWithOpts clientOpts deleteOpts cid = (^. responseStatus) <$>
70deleteContainerWithOpts clientOpts deleteOpts cid = (^. responseStatus) <$>
Network/Docker/Types.hs+1−1
@@ -70,7 +70,7 @@ data SEndpoint (a :: Endpoint) where
70
70
71defaultClientOpts :: DockerClientOpts
71defaultClientOpts :: DockerClientOpts
72defaultClientOpts = DockerClientOpts
72defaultClientOpts = DockerClientOpts
73− { apiVersion = "v1.20"
73+ { apiVersion = "v1.22"
74 , baseUrl = "http://127.0.0.1:2375/"
74 , baseUrl = "http://127.0.0.1:2375/"
75 , ssl = NoSSL
75 , ssl = NoSSL
76 }
76 }
tests/Dockerfile+1−6
@@ -1,9 +1,4 @@
1FROM debian:jessie
1FROM debian:jessie
2
2
3−RUN apt-get update && apt-get install -y --no-install-recommends \
3+CMD ["/bin/bash", "-c", "echo 123"]
4− python
5−
6−RUN echo "#!/usr/bin/python\nprint '123'" > /entrypoint.py
7−RUN chmod +x /entrypoint.py
8−CMD ["python", "entrypoint.py"]
9
4
tests/tests.hs+6−5
@@ -1,8 +1,5 @@
1module Main where
1module Main where
2
2
3−import Network.Docker
4−import Network.Docker.Types
5−
6import qualified Test.QuickCheck.Monadic as QCM
3import qualified Test.QuickCheck.Monadic as QCM
7import Test.Tasty
4import Test.Tasty
8import Test.Tasty.HUnit
5import Test.Tasty.HUnit
@@ -17,7 +14,11 @@ import Data.Text (unpack)
17import Network.HTTP.Types.Status
14import Network.HTTP.Types.Status
18import System.Process (system)
15import System.Process (system)
19
16
17+import Network.Docker
18+import Network.Docker.Types
19+
20+
20−opts = defaultClientOpts { baseUrl = "http://127.0.0.1:2375/" }
21+opts = defaultClientOpts
21
22
22test_image_name = "docker-hs-test"
23test_image_name = "docker-hs-test"
23
24
@@ -28,7 +29,7 @@ checkDockerVersion = do v <- getDockerVersion opts
28 assert $ isJust v
29 assert $ isJust v
29
30
30findTestImage :: IO ()
31findTestImage :: IO ()
31−findTestImage = do images <- getDockerImages opts
32+findTestImage = do images <- listImages opts
32 let x = fmap (filter ((== [test_image_name++":latest"]) . _repoTags)) images
33 let x = fmap (filter ((== [test_image_name++":latest"]) . _repoTags)) images
33 assert $ fmap length x == Just 1
34 assert $ fmap length x == Just 1
34
35