repo2docker
repo2docker copied to clipboard
Error after building image: /bin/bash: /usr/local/bin/repo2docker-entrypoint: Permission denied
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 versionClient: 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 --version0.10.0
The only thing I did differently was to install as --user rather than root:
python3 -m pip install --user jupyter-repo2docker
Could you double check that your directory is really empty? The log output says that repo2docker is using the R buildpack which should only happen if there is a file that specifically triggers that buildpack.
Just double-checked. Still get the error; here are the last few lines:
Removing intermediate container 8e72c6d64d4b
---> 6de510ce01ec
Step 38/46 : COPY src/ ${REPO_DIR}
---> 8548341bd3ee
Step 39/46 : RUN chown -R ${NB_USER}:${NB_USER} ${REPO_DIR}
---> Running in d3bfd4b2a41e
Removing intermediate container d3bfd4b2a41e
---> 11cd2f6e0791
Step 40/46 : LABEL repo2docker.ref="None"
---> Running in ee57b22ab9a4
Removing intermediate container ee57b22ab9a4
---> 251b0c53b122
Step 41/46 : LABEL repo2docker.repo="local"
---> Running in e40b8d9d72e2
Removing intermediate container e40b8d9d72e2
---> b227b857d8da
Step 42/46 : LABEL repo2docker.version="0.10.0"
---> Running in f54a565cc0d2
Removing intermediate container f54a565cc0d2
---> c7e3544f0193
Step 43/46 : USER ${NB_USER}
---> Running in 1c63b72b549a
Removing intermediate container 1c63b72b549a
---> abc3d5f9bcf2
Step 44/46 : COPY /repo2docker-entrypoint /usr/local/bin/repo2docker-entrypoint
---> f4df5749e0b4
Step 45/46 : ENTRYPOINT ["/usr/local/bin/repo2docker-entrypoint"]
---> Running in f316613ea49e
Removing intermediate container f316613ea49e
---> c671d18686bc
Step 46/46 : CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]
---> Running in d7c3b672d4e2
Removing intermediate container d7c3b672d4e2
---> 659f338f26c8
{"aux": {"ID": "sha256:659f338f26c86c9a46d70c64351a1656330ed5f77de87a2936e9b38df01b9575"}}Successfully built 659f338f26c8
Successfully tagged r2d-2e1568392584:latest
/bin/bash: /usr/local/bin/repo2docker-entrypoint: Permission denied
[stephen@light f1]$ ls -lh
total 0
[stephen@light f1]$
Does Using RBuildPack builder still appear at the top of the log output?
I don't have a good idea unfortunately and can't reproduce it either :-/
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
Do you want to create a PR to fix this? I'm not sure I fully understand how we end up with those permissions but explicitly changing the permissions seems harmless.
Do you understand why it had to be moved up to where it will run as root? When you listed /usr/local/bin (before your patch?) it shows that the file is already owned by root and not $NB_USER. Weird no?
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
I'm also getting this issue with a pipx installation of repo2docker. It's fixed if I chmod the template files inside the pip-installed package.