Running Jupyter Notebook in Ubuntu Docker Container

Recently I attempted to run Jupyter Notebook in Ubuntu Docker container for a project requiring OpenCV and PyTorch. Sharing the Docker configuration files I used here.

docker-compose.yml

version: "3"

services: 
  ml-docker:
    build: .
    container_name: ML-docker
    stdin_open: true
    tty: true
    ports:
      - '8888:8888'
    volumes: 
      - $PWD/shared:/shared

Jupyter notebook listens on port 8888 by default. So, I am mapping it to the same port on the host machine. I have also created a folder ‘shared’ in the same folder where above docker-compose.yml is located. And I have made this folder accessible to the container using volumes declaration. The above file instructs docker to build Dockerfile in the same folder. Content of the Dockerfile is as follows –

Continue reading “Running Jupyter Notebook in Ubuntu Docker Container”

Social