Skip to content

Commit

Permalink
Docker: strip suffix from docker --version
Browse files Browse the repository at this point in the history
fixes #1653
  • Loading branch information
borsboom committed Jan 30, 2016
1 parent 0200591 commit 8ca93bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Other enhancements:

* Docker: pass ~/.ssh and SSH auth socket into container, so that git repos
work [#1358](https://github.com/commercialhaskell/stack/issues/1358)
* Docker: strip suffix from docker --version
[#1653](https://github.com/commercialhaskell/stack/issues/1653)

Bug fixes:

Expand Down
3 changes: 2 additions & 1 deletion src/Stack/Docker.hs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ checkDockerVersion envOverride docker =
dockerVersionOut <- readDockerProcess envOverride ["--version"]
case words (decodeUtf8 dockerVersionOut) of
(_:_:v:_) ->
case parseVersionFromString (dropWhileEnd (not . isDigit) v) of
case parseVersionFromString (stripVersion v) of
Just v'
| v' < minimumDockerVersion ->
throwM (DockerTooOldException minimumDockerVersion v')
Expand All @@ -711,6 +711,7 @@ checkDockerVersion envOverride docker =
_ -> throwM InvalidVersionOutputException
where minimumDockerVersion = $(mkVersion "1.6.0")
prohibitedDockerVersions = []
stripVersion v = fst $ break (== '-') $ dropWhileEnd (not . isDigit) v

-- | Remove the project's Docker sandbox.
reset :: (MonadIO m, MonadReader env m, HasConfig env)
Expand Down

0 comments on commit 8ca93bb

Please sign in to comment.