Skip to content
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

Set entrypoint script exection bit when generating Dockerfile #861

Closed
srenkens opened this issue Aug 11, 2016 · 1 comment
Closed

Set entrypoint script exection bit when generating Dockerfile #861

srenkens opened this issue Aug 11, 2016 · 1 comment

Comments

@srenkens
Copy link

We are using sbt docker:stage to generate a Dockerfile which is used by docker-compose to build our application image. Our Windows developers are facing the fact that the entrypoint script gets added to the image without the execution bit set.

The Dockerfile which is generated by sbt docker:stage does not set the execution bit on the entrypoint script. This is not an issue issue for Mac / Linux users but for Windows users the file get added with a default 664 mask.

To workaround this issues we needed to add the following code fragment below to our dockerSettings.

dockerCommands ++= Seq (
      // setting the run script executable
      ExecCmd("RUN", "chmod", "u+x", s"${(defaultLinuxInstallLocation in Docker).value}/bin/${executableScriptName.value}")
    )

It would be more robust if a chmod u+x <entrypointscript> line was added to the generated Dockerfile by default by the sbt-native-packager.

Regards
Sebastiaan

@muuki88
Copy link
Contributor

muuki88 commented Aug 21, 2016

Thanks for your feature request. The layer added by this command is rather small as it only affects this one bin, right?

I'm not sure how we should integrate this fix. Docker support for windows is really getting good, so others are likely to have this problem as well. My main concern is that putting OS specific fixes into the general plugin will finally bloat the plugin and make it really hard to change. Furthermore we don't have an CI for our docker infrastructure, which makes changes even harder to review. Setting up a windows/docker environment however is really tough with free-for-open-source tools ( at least at the moment).

So I would have two suggestions for this fix

  1. Provide the workaround in the docs
  2. Provide a WindowsDockerPlugin, which adds these fixes for windows and user can enable it if necessary

I think the chances getting permissions to work on windows are rather... non existent?

@muuki88 muuki88 closed this as completed May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Docker
Feature Requests
Development

No branches or pull requests

2 participants