I have a script in src/docker/opt/docker/bin/launch.sh.
The generated Dockerfile:
RUN ["chmod", "-R", "u=rX,g=rX", "/opt/docker"]
RUN ["chmod", "u+x,g+x", "/opt/docker/bin/server"]
RUN ["chmod", "u+x,g+x", "opt/docker/bin/launch.sh"]
 
See the missing / in front of opt that leads to the following error when Docker/publishLocal:
chmod: cannot access 'opt/docker/bin/launch.sh': No such file or directory
 
Workaround:
inConfig(Docker)(
  dockerPackageMappings := MappingsHelper
    .contentOf(sourceDirectory.value)
    .map { case (from, to) => from -> Paths.get("/", to).toString }
)
 
Thanks