question-mark
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.

Error after building image: /bin/bash: /usr/local/bin/repo2docker-entrypoint: Permission denied

See original GitHub issue

Bug description

running repo2docker on an empty directory (to get a default python environment), I get:

jupyter-repo2docker .
Picked Local content provider.
Using local repo ..
Using RBuildPack builder
...
Step 44/46 : COPY /repo2docker-entrypoint /usr/local/bin/repo2docker-entrypoint
 ---> Using cache
 ---> 1a386e8b05e3
Step 45/46 : ENTRYPOINT ["/usr/local/bin/repo2docker-entrypoint"]
 ---> Using cache
 ---> dea2b546b748
Step 46/46 : CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]
 ---> Using cache
 ---> 71d561c90128
{"aux": {"ID": "sha256:71d561c901289655ff31f29b3209774cae2c3853ea67e132c05a1215a47db035"}}Successfully built 71d561c90128
Successfully tagged r2d-2e1567611552:latest
/bin/bash: /usr/local/bin/repo2docker-entrypoint: Permission denied

Expected behaviour

I thought the jupyter notebook would launch.

Actual behaviour

Error

How to reproduce

Your personal set up

  • OS: manjaro linux

  • Docker version: docker version Client: Version: 19.03.1-ce API version: 1.40 Go version: go1.12.7 Git commit: 74b1e89e8a Built: Sat Jul 27 21:08:50 2019 OS/Arch: linux/amd64 Experimental: false

Server: Engine: Version: 19.03.1-ce API version: 1.40 (minimum version 1.12) Go version: go1.12.7 Git commit: 74b1e89e8a Built: Sat Jul 27 21:08:28 2019 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.2.7.m GitCommit: 85f6aa58b8a3170aec9824568f7a31832878b603.m runc: Version: 1.0.0-rc8 GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f docker-init: Version: 0.18.0 GitCommit: fec3683

  • repo2docker version repo2docker --version 0.10.0

The only thing I did differently was to install as --user rather than root:

python3 -m pip install --user jupyter-repo2docker

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
megiescommented, Oct 4, 2019

Had the same problem, file permissions on the extra point were set weirdly for whatever reason.

Here’s a patch that makes it work for me:

diff --git a/repo2docker/buildpacks/base.py b/repo2docker/buildpacks/base.py
index 49e3907..a1d3d24 100644
--- a/repo2docker/buildpacks/base.py
+++ b/repo2docker/buildpacks/base.py
@@ -162,6 +162,10 @@ RUN chown -R ${NB_USER}:${NB_USER} ${REPO_DIR}
 LABEL {{k}}="{{v}}"
 {%- endfor %}
 
+# Add entrypoint
+COPY /repo2docker-entrypoint /usr/local/bin/repo2docker-entrypoint
+RUN chmod a+rx /usr/local/bin/repo2docker-entrypoint
+
 # We always want containers to run as non-root
 USER ${NB_USER}
 
@@ -179,8 +183,6 @@ RUN chmod +x "{{ start_script }}"
 ENV R2D_ENTRYPOINT "{{ start_script }}"
 {% endif -%}
 
-# Add entrypoint
-COPY /repo2docker-entrypoint /usr/local/bin/repo2docker-entrypoint
 ENTRYPOINT ["/usr/local/bin/repo2docker-entrypoint"]
 
 # Specify the default command to run

These were file permissions in the built docker image for me, which caused the issue:

megies@4820c466f1bd:~$ ls -l /usr/local/bin
total 4
-rwx--x--x 1 root root 284 Oct  4 11:26 repo2docker-entrypoint
0reactions
giannisdoukascommented, Jun 29, 2020

I have the same issue and it is reproducible if you install it repo2docker in Travis with a simple pip install. Because I do not see any PR I will make one

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker entrypoint running bash script gets "permission denied"
I don't undertand, when I run docker build the imtermediate container works fine. But when I do docker run , it throws such...
Read more >
Bash permission denied Explanation and Solution
Bash permission denied. The Bash permission denied error happens when you try to run a file which you do not have permission to...
Read more >
bash: bin/magento: Permission denied - Fix - Magefan
When you run CLI command bin/magento and get the error "Permission denied", please follow these steps to fix the issue.
Read more >
"/bin/bash: .command.run: Permission denied" with SELinux ...
Hi I faced the following "/bin/bash: .command.run: Permission denied" when running nf-core/nanoseq with with profile test,docker.
Read more >
How to Fix Shell Script Permission Denied Error in Linux
The shell script permission denied error occurs when the shell script you're trying to run doesn't have the permissions to execute.
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found