-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker version detection fails on Ubuntu 16.04 #1230
Comments
CC: @eed3si9n TBH I got a bit lost in the code trying to work out how the version determines the strategy, so I might have misdiagnosed, but this is my best guess at what's happening. |
I don't think I was involved in Docker version detection code, but apparently Debian Policy Manual says you can use alphanumerics and the characters |
It's been a while, but looking at the code, the build user is always in control of the permission strategy. DockerPlugin just sets the following default: dockerPermissionStrategy := DockerPermissionStrategy.MultiStage,
dockerChmodType := DockerChmodType.UserGroupReadExecute Where Docker version gets involved is the validation of the specified strategy in https://github.com/sbt/sbt-native-packager/blob/v1.3.21/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala#L607-L646 Either case, I'd be happy to send a PR to improve the regex. |
I have a PR here - #1231 |
Changing the build semantics (even if it's changing |
All good points. Maybe one day sbt-native-packager can be reworked to use jib to build images rather than requiring an external Docker. Thanks for the PR! |
I'm thinking that if I'll try to throw a PR together if I ever have some free time, but that might not happen soon. |
Very simple reasoning. That's why default version should be Run, because it works everywhere. It is bad to make backward incompatible changes from feature requests, always think about majority, if one wants to save 130MB from 2GB footprint -> sure that's a great thing, but make it so it requires an extra config option if you can't provide a reliable switch mechanism (read Regex version parser, which is unreliable in my opinion). |
Currently the we have the |
* Improve Docker version detection Fixes #1230 * Add a comment on dockerPermissionStrategy
Thanks @muuki88. The Spotify Java client is a little different, in that it still requires a running Docker Engine to communicate with, whereas jib builds OCI-compatible images directly without requiring Docker at all, so it's more self contained. Fair enough on the maintainer resources consideration, although I expect Lightbend teams to continue to contribute to sbt-native-packager in the future as needed. I think it still makes sense to make a couple of additional minor improvements to this:
I raised separate issues for these. @muuki88 if you agree with the suggestions, maybe the community can help out. |
@TimMoore thanks for taking care and creating the issues. I'll comment on the separate issues. |
Expected behaviour
sbt docker:publish
(orsbt docker:publishLocal
) should succeed on Ubuntu 16.04 systems.Actual behaviour
I think the problem is that the reported Docker version (
17.05.0~ce-0~ubuntu-xenial
) doesn't match the regex used to determine Docker version and fall back to runningchown
explicitly in the build. The problem seems to be the "~" character isn't matched by the pattern:sbt-native-packager/src/main/scala/com/typesafe/sbt/packager/docker/DockerVersion.scala
Line 8 in 435c155
(It's hard to see, but in the second example, the "~" was changed to a "-").
I'd suggest two fixes:
Information
(Note: I'm filing this on behalf of @kotdv, who reported this on the lagom/lagom Gitter channel. I don't have an Ubuntu 16.04 system handy to reproduce this on.)
The text was updated successfully, but these errors were encountered: