logspout: ./build.sh: Permission denied
Environment:
- Windows 10
- Docker version 1.12.1
- docker-compose version 1.8.0 and Docker Hub
I had the missing gcc error and did the workaround of using gliderlabs/logspout:master and putting a copy of build.sh in my local directory. Now when I try to build, I get an error of ./build.sh: Permission denied. You can see full build log at https://hub.docker.com/r/nikki603/logspoutkinesis/builds/bchksm9an3agrmdxavr5o78/
I get the same error when running docker-compose locally.
docker-compose build logspout
Building logspout
Step 1 : FROM gliderlabs/logspout:master
# Executing 3 build triggers...
Step 1 : COPY ./build.sh /src/build.sh
Step 1 : COPY ./modules.go /src/modules.go
Step 1 : RUN cd /src && ./build.sh "$(cat VERSION)-custom"
---> Running in 48852ae2f7b1
/bin/sh: ./build.sh: Permission denied
ERROR: Service 'logspout' failed to build: The command '/bin/sh -c cd /src && ./build.sh "$(cat VERSION)-custom"' returned a non-zero code: 126
build.sh file permission locally are -rwxr-xr-x
I believe this is related to bug https://github.com/docker/compose/issues/3716
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 21 (8 by maintainers)
Commits related to this issue
- set exec bit on build.sh fixes #238 — committed to gliderlabs/logspout by michaelshobbs 7 years ago
Yep, this will be resolved in Docker Compose 1.9.0. until then you’ll need to add
RUN chmod +x /src/build.shto your Dockerfile.Can
RUN chmod +x /src/build.shreally help? A docker build executes ONBUILD commands before any command in a child Dockerfile. Therefore,ONBUILD RUN cd /src && ./build.sh "$(cat VERSION)-custom"will be executed beforeRUN chmod +x /src/build.sh.I’ve got the same issue but in my case I build my custom image in a build pipeline and when the build agent (GOCD) pulls the files to build a custom logspout, build.sh has the following attributes
-rw-r--r--. 1 go docker 417 Nov 11 11:12 build.shand docker build fails with the same error.I believe that
RUN chmod +x /src/build.shshould be in logspout’s Dockerfile.I’m not using docker-compose at all, a simple docker build is failing if you develop on Windows and build on Linux roudtriping your code through a Git server (in my case it’s even worse, it’s Microsoft’s TFS Git) because the file permissions are different. There is no way to specify +x permission on Windows 7. Moreover, I don’t think it’s guaranteed by git spec to preserve the file permissions at all, it just happens that GitHub supports it for the Linux-to-Linux workflow. Please correct me if I’m wrong.