Docker Community Forums

Share and learn in the Docker community.

Issue running Jupyter Kernel Gateway on Docker

(Abhinavshroff) #1

When executing the Docker container: When I try to pip install jupyter_kernel_gateway within docker I get a

PermissionError: [Errno 13] Permission denied: ‘/srv/notebooks/my_api.ipynb’ error.

While if I try using pip install --user jupyter_kernel_gateway then I get error
jupyter: ‘kernelgateway’ is not a Jupyter command.

What is the solution if I use pip install with --user

(Gary Forghetti) #2

Hi.

Example:

Dockerfile

FROM ubuntu:latest

CMD jupyter kernelgateway

EXPOSE 8888

RUN apt-get update -qq && \                                 
    apt-get install curl python3 -y && \
    apt install python3-venv python3-pip -y && \
    pip3 install jupyter_kernel_gateway

Build a docker image with python and Jupyter Kernel Gateway

docker image build -t my-container:latest .

Run a container from the docker image

🐳  gforghetti:[~/Downloads] $ docker container run -it --name web-server -d --publish 8888:8888 my-container:latest
c60f502146673f2877b5742617a865f3a9b86b517cbfa2669713c1f9c3574eab
🐳  gforghetti:[~/Downloads] $ docker container logs web-server
[KernelGatewayApp] Jupyter Kernel Gateway at http://127.0.0.1:8888