on master help sign in
A few fixups

Fix default delete endpoint (pass in defaults). Fix wrong function called in test. Simplify Dockerfile for faster builds (but same result) Bump default Docker Remote API version to 1.22 WARNING: Tests still fail though.

commite2bc554ed3110b0b6dc284e919fb114cea2348d0 authorDeni Bertovic <deni@denibertovic.com> dateTue 23 Feb 2016, 17:33 (11 years ago) parent6477978
4 files changed+10−14
Network/Docker.hs+2−2 Network/Docker/Types.hs+1−1 tests/Dockerfile+1−6 tests/tests.hs+6−5
Network/Docker.hs+2−2
@@ -63,8 +63,8 @@ unpauseContainer :: DockerClientOpts -> String -> IO (Status)
6363unpauseContainer clientOpts cid = (^. responseStatus) <$>
6464 runDocker (unpauseContainerM clientOpts (SUnpauseContainerEndpoint cid))
6565
66−deleteContainer :: DockerClientOpts -> DeleteOpts -> String -> IO (Status)
67−deleteContainer c d cid = deleteContainerWithOpts c d cid
66+deleteContainer :: DockerClientOpts -> String -> IO (Status)
67+deleteContainer c cid = deleteContainerWithOpts c defaultDeleteOpts cid
6868
6969deleteContainerWithOpts :: DockerClientOpts -> DeleteOpts -> String -> IO (Status)
7070deleteContainerWithOpts clientOpts deleteOpts cid = (^. responseStatus) <$>
Network/Docker/Types.hs+1−1
@@ -70,7 +70,7 @@ data SEndpoint (a :: Endpoint) where
7070
7171defaultClientOpts :: DockerClientOpts
7272defaultClientOpts = DockerClientOpts
73− { apiVersion = "v1.20"
73+ { apiVersion = "v1.22"
7474 , baseUrl = "http://127.0.0.1:2375/"
7575 , ssl = NoSSL
7676 }
tests/Dockerfile+1−6
@@ -1,9 +1,4 @@
11FROM debian:jessie
22
3−RUN apt-get update && apt-get install -y --no-install-recommends \
4− python
5−
6−RUN echo "#!/usr/bin/python\nprint '123'" > /entrypoint.py
7−RUN chmod +x /entrypoint.py
8−CMD ["python", "entrypoint.py"]
3+CMD ["/bin/bash", "-c", "echo 123"]
94
tests/tests.hs+6−5
@@ -1,8 +1,5 @@
11module Main where
22
3−import Network.Docker
4−import Network.Docker.Types
5−
63import qualified Test.QuickCheck.Monadic as QCM
74import Test.Tasty
85import Test.Tasty.HUnit
@@ -17,7 +14,11 @@ import Data.Text (unpack)
1714import Network.HTTP.Types.Status
1815import System.Process (system)
1916
20−opts = defaultClientOpts { baseUrl = "http://127.0.0.1:2375/" }
17+import Network.Docker
18+import Network.Docker.Types
19+
20+
21+opts = defaultClientOpts
2122
2223test_image_name = "docker-hs-test"
2324
@@ -28,7 +29,7 @@ checkDockerVersion = do v <- getDockerVersion opts
2829 assert $ isJust v
2930
3031findTestImage :: IO ()
31−findTestImage = do images <- getDockerImages opts
32+findTestImage = do images <- listImages opts
3233 let x = fmap (filter ((== [test_image_name++":latest"]) . _repoTags)) images
3334 assert $ fmap length x == Just 1
3435