Building Docker fails to chmod it .sh files
See original GitHub issueI 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 😊
@muuki88 - I’ve created a repro here: https://github.com/hackcave/sbt-native-packager-docker-issue-1304 ,
sbt docker:publishLocal
should give you the error. we can see the file exists at/opt/bin/docker/entrypoint.sh
within the docker image, but the generatedchmod
command fails to add/
prefix.