Skip to content

Building Docker fails to chmod it .sh files #1304

@joan38

Description

@joan38

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions