PermissionError: [Errno 13] Permission denied: '/home/beakerx/.local/share'
- Dominant language
- Jupyter Notebook
- Stars
- 2.9k
- Forks
- 383
- PR merge metrics
- No merged PRs in 30d
Description
I write a Dockerfile and docker-compose.yml, which contents are below.
```
FROM beakerx/beakerx
MAINTAINER liudonghua123
# not works
#RUN conda install xeus-cling notebook -c QuantStack -c conda-forge -y --quiet
USER root
# install gcc7
RUN add-apt-repository -y ppa:jonathonf/gcc-7.2
RUN apt-get update -y
RUN apt-get install -y gcc-7
# revert to beakerx user
USER beakerx
ARG CLING_FILENAME=cling_2018-09-04_ubuntu16
RUN echo "use ${CLING_FILENAME} for build"
# add the prebuild cling packages
ADD ${CLING_FILENAME}.tar.bz2 /home/beakerx
ENV PATH=/home/beakerx/${CLING_FILENAME}/bin:$PATH
USER root
RUN pip install --upgrade pip
# install steps, https://github.com/root-project/cling/tree/master/tools/Jupyter
RUN cd /home/beakerx/${CLING_FILENAME}/share/cling/Jupyter/kernel && pip install -e . && jupyter-kernelspec install --user cling-cpp17 && jupyter-kernelspec install --user cling-cpp1z && jupyter-kernelspec install --user cling-cpp14 && jupyter-kernelspec install --user cling-cpp11
RUN ln -s /usr/bin/gcc-7 /usr/bin/gcc
RUN echo "root:root" | chpasswd
RUN echo "beakerx:beakerx" | chpasswd
RUN chown -R beakerx:beakerx /home/beakerx/.local
RUN find /home/beakerx/.local -type d -exec chmod 755 {} \;
RUN find /home/beakerx/.local -type f -exec chmod 644 {} \;
RUN id
RUn ls -la /home/beakerx/.local
RUn ls -la /home/beakerx/.local/share
USER beakerx
```
```
version: '2'
services:
beakerx-cling-prebuild:
build: .
image: liudonghua123/beakerx-cling-prebuild:latest
ports:
- "28888:8888"
volumes:
- ./work:/work
restart: always
```
But I got the following error logs
```
beakerx-cling-prebuild_1 | Traceback (most recent call last):
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/bin/jupyter-notebook", line 6, in
beakerx-cling-prebuild_1 | sys.exit(notebook.notebookapp.main())
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
beakerx-cling-prebuild_1 | return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
beakerx-cling-prebuild_1 | app.initialize(argv)
beakerx-cling-prebuild_1 | File "", line 2, in initialize
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
beakerx-cling-prebuild_1 | return method(app, *args, **kwargs)
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/notebook/notebookapp.py", line 1505, in initialize
beakerx-cling-prebuild_1 | self.init_configurables()
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/notebook/notebookapp.py", line 1209, in init_configurables
beakerx-cling-prebuild_1 | connection_dir=self.runtime_dir,
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
beakerx-cling-prebuild_1 | return self.get(obj, cls)
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
beakerx-cling-prebuild_1 | value = self._validate(obj, dynamic_default())
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/jupyter_core/application.py", line 99, in _runtime_dir_default
beakerx-cling-prebuild_1 | ensure_dir_exists(rd, mode=0o700)
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/site-packages/jupyter_core/utils/__init__.py", line 13, in ensure_dir_exists
beakerx-cling-prebuild_1 | os.makedirs(path, mode=mode)
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/os.py", line 210, in makedirs
beakerx-cling-prebuild_1 | makedirs(head, mode, exist_ok)
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/os.py", line 210, in makedirs
beakerx-cling-prebuild_1 | makedirs(head, mode, exist_ok)
beakerx-cling-prebuild_1 | File "/opt/conda/envs/beakerx/lib/python3.6/os.py", line 220, in makedirs
beakerx-cling-prebuild_1 | mkdir(name, mode)
beakerx-cling-prebuild_1 | PermissionError: [Errno 13] Permission denied: '/home/beakerx/.local/share'
```
During the docker-compose build, I saw the permission of /home/beakerx/.local/share was correct.
```
Step 22/24 : RUN ls -la /home/beakerx/.local
---> Running in 95457585aed0
total 12
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 .
drwxr-xr-x 25 beakerx beakerx 4096 Sep 6 00:51 ..
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 share
---> affcb9f1ca94
Removing intermediate container 95457585aed0
Step 23/24 : RUN ls -la /home/beakerx/.local/share
---> Running in 15ea51bcc3bf
total 12
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 .
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 ..
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 jupyter
---> 6f2ca28d4d21
Removing intermediate container 15ea51bcc3bf
Step 24/24 : USER beakerx
---> Running in 0ab6574079d7
---> 9561902b99ef
Removing intermediate container 0ab6574079d7
Successfully built 9561902b99ef
```
When I run `docker run -it --entrypoint='' --rm liudonghua123/beakerx-cling-prebuild bash` to saw the actural permission, it was incorrect.
```
ldh@ldh55:~/docker/cling/jupinger/beakerx-cling-prebuild$ docker run -it --entrypoint='' --rm liudonghua123/beakerx-cling-prebuild bash
beakerx@6c166e73043e:~$
beakerx@6c166e73043e:~$ ls -la .local
ls: cannot access '.local/share': Permission denied
total 8
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 .
drwxr-xr-x 25 beakerx beakerx 4096 Sep 6 00:51 ..
d????????? ? ? ? ? ? share
beakerx@6c166e73043e:~$ su
Password:
root@6c166e73043e:/home/beakerx# ls -la .local
total 12
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 .
drwxr-xr-x 25 beakerx beakerx 4096 Sep 6 00:51 ..
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 share
root@6c166e73043e:/home/beakerx# ls -la .local/share/
total 12
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 .
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 ..
drwxr-xr-x 6 beakerx beakerx 4096 Sep 6 00:51 jupyter
root@6c166e73043e:/home/beakerx#
```
Any ideas about this?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.