-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
./build.sh: Permission denied #238
Comments
Yep, this will be resolved in Docker Compose 1.9.0. until then you'll need to add |
Can 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 I believe that |
@anisimovsergey What version of docker-compose are you using? This should be fixed in 1.9.0. |
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. |
@anisimovsergey Which version of Git are you using? The executable bit is synthesized, meaning that when you're using Windows to build an image, Docker will |
The Git version I'm using on Windows is "Git for Windows 2.8.1". I'm using windows git and building my Docker images on a Virtual Box VM with Ubuntu 14.04.5. All my files in a mapped folder from windows have permissions: -rwxrwxrwx and all the folders: drwxrwxrwx because Virtual Box doesn't know about the real permissions it falls back with enabling everything. Docker version I'm using for building in the VM is: 1.11.2 I can build my image successfully in this environment using logspout's original docker image, no problem at all. However, on my build agent which is running on CentOS 7.2, I'm using Git client 1.8.3.1 and docker version 1.12.3. 17:53:38.032 Step 1 : COPY ./build.sh /src/build.sh
17:53:38.033 Step 1 : COPY ./modules.go /src/modules.go
17:53:38.033 Step 1 : RUN cd /src && ./build.sh "$(cat VERSION)-custom"
17:53:38.033 ---> Running in 0ac0f8ce2106
17:53:38.033 /bin/sh: ./build.sh: Permission denied I have a workaround but I would rather prefer using the original logspout's Dockerfile. |
Can you change that line to chmod +x and then the execution? |
No I can't, because those lines are from the logspout's Dockerfile ONBUILD COPY ./build.sh /src/build.sh Nether can I do |
Would this fix it?
|
@josegonzalez Yes, indeed, the proposed change should fix the problem. |
I'm getting the same error and that prevents me from running my custom logspout image. |
This issue was reintroduced in ae888cc? @michaelshobbs |
@trondvh can you file a new issue with the full output of the issue you are seeing? |
Same, am getting this issue again As @trondvh says, the previous fix, "&& chmod +x build.sh", looks like it was removed from the Dockerfile as part of recent update Is it not needed anymore? |
@djeeg Can you post more info about your environment (e.g. your Docker version)? |
I checked the file in with the executable bit set and I just verified that a new clone of the repo shows that it's executable. Not sure why you're still seeing this issue. Feel free to open a PR to bring back the chmod cmd if needed. |
Note: this works when I build the image locally using [Windows host + hyper-V + docker-machine + boot2docker + docker 17.11.0] It doesn't work if I build the image in the cloud using [Visual Studio Online + GIT repository] Project structure is standard
Dockerfile has modules.go has When triggering a build in VSTS, this happens (other images in VSTS are building okay) 2017-11-30T11:11:33.5307250Z ##[section]Starting: Build an image |
are you copying |
The same for me, building a custom image with gitlab-ci:
As you are using ONBUILD in the base file, I don't believe that a chmod in the downstream Dockerfile will help, as build.sh is executed by ONBUILD in the base file. |
I don't think I follow what you're saying. It doesn't matter which dockerfile calls the script as long as the script itself is executable in current docker build context. That being said, I will gladly accept a PR that brings back the |
Looks fixed, thanks for merging!
|
Environment:
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.
build.sh file permission locally are -rwxr-xr-x
I believe this is related to bug docker/compose#3716
The text was updated successfully, but these errors were encountered: