Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building Docker fails to chmod it .sh files

See original GitHub issue

I have a script in src/docker/opt/docker/bin/

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/"]

See the missing / in front of opt that leads to the following error when Docker/publishLocal:

chmod: cannot access 'opt/docker/bin/': No such file or directory


  dockerPackageMappings := MappingsHelper
    .map { case (from, to) => from -> Paths.get("/", to).toString }


Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

muuki88commented, Jun 13, 2020

Thanks a lot for putting together a reproducible test case.

To he honest I don’t know if I have the time to work on this, but if you would like to do I’ll give you all necessary guidance you need 😊

adarshajcommented, Jun 10, 2020

@muuki88 - I’ve created a repro here: , sbt docker:publishLocal should give you the error. we can see the file exists at /opt/bin/docker/ within the docker image, but the generated chmod command fails to add / prefix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker run fails to run shell script (file not found) although the ...
Now here comes with my problem, when I execute docker run like below, I get the error: docker run -i privaterepoexample/sre docker: Error...
Read more >
chmod not working correctly in Docker - Server Fault
The default shell of RUN in Docker is /bin/sh and this is where the permissions not being set correctly actually has a problem....
Read more >
Dockerfile RUN chmod does not work - Compose
I'm working on a project for a home webservice and I am setting up a bind9 container using docker-compose.
Read more >
Troubleshooting Docker Permission Denied Problems
Many factors could lead to a permission denied error while connecting to Docker. One of those factors is that you may be running...
Read more >
How to Fix Docker Permission Denied? - phoenixNAP
How to Fix Docker Permission Denied? · What is Docker Permission Denied Error · Method 1: Restart Docker Engine · Method 2: Run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found