Docker Containerization Guidelines#

Important

By default, all Docker containers are pre-configured and ready to use.

The editable development version of scikit-plots is already installed, so you can verify the installation immediately by running:

scikitplot -V

Important

Once the Docker environment is ready to use, you can proceed to the quickstart section to verify the build:

See Checking the scikit-plots build.

πŸ‹ Docker Containerization#

πŸ’‘ Work on Docker Desktop or Github Codespaces

Here’s how containerization works:

  • Isolation: Containers run independently of each other and the host system, ensuring that they don’t interfere with other applications or containers.

  • Portability: Since containers include everything the application needs to run, they can be moved between different environments (like from development to production) without any compatibility issues.

  • Efficiency: Containers are more lightweight than virtual machines (VMs) because they share the host OS’s kernel rather than running their own separate operating system. This makes them faster and more resource-efficient.

  • Consistency: The application inside the container runs the same way regardless of where it’s deployed, ensuring consistency across environments.

🏷️ Github Codespaces Guide#

(Connect IDE Interface Vscode or Jupyter Notebook)

πŸ‘‰ (recommended) Choose (recommended) not (default) Option for best practise:

Open in GitHub Codespaces

Step by step:



🏷️ Docker Desktop Guide#

## Forked repo: https://github.com/scikit-plots/scikit-plots.git
git clone https://github.com/YOUR-USER-NAME/scikit-plots.git
cd scikit-plots/docker

## Use terminal or open to vscode to run ``docker compose``
code .

Docker Environment Setup for IDE (Vscode/Jupyter) and/or NVIDIA GPU driver

This repository contains Docker & Docker Compose configurations for running Jupyter Notebooks with optional NVIDIA GPU support.

You can run containers with either host-installed CUDA or pre-installed CUDA inside the container.

🐳 Docker Compose Quickstart Guide#

(Optionally) πŸ“¦ Prebuilt Image from Docker Hub#

See also

You can use the prebuilt image directly from Docker Hub:

πŸ“„ Docker Hub: `https://hub.docker.com/r/scikitplot/scikit-plots`__

# docker pull scikitplot/scikit-plots
docker run -it --rm scikitplot/scikit-plots bash

🏷️ Using Docker Compose: The easiest way to launch the environment.#

▢️ Run Docker Env Jupyter Notebook (CPU only)

docker compose up --build scikit-plots_latest-jupyter

▢️ Run Docker Env Jupyter Notebook (With NVIDIA Host GPU)

docker compose up --build app_nvidia_host_gpu_driver

▢️ Run Docker Env Jupyter Notebook (With NVIDIA Internal CUDA GPU)

docker compose up --build app_nvidia_internal_gpu_driver

▢️ Run Docker Env Jupyter Notebook by VS Code#

▢️ Connect Docker Container Especially When Docker-GUI dont available#

# docker-compose up --build scikit-plots_latest-jupyter

docker ps  # check running containers
docker logs CONTAINER_ID_OR_NAME  # find jupyter (token) http address 127.0....
docker exec -it CONTAINER_ID_OR_NAME bash  # Connect interactive terminal

▢️ Run setup_vscode_ext.sh#

## (Optionally) Install common vscode extensions
##βœ… C/C++/Python and Jupyter Notebook
##βœ… Linter and Formatter
bash docker/scripts/setup_vscode_ext.sh  # (not needed every time)

▢️ Run post_create_commands.sh#

β€œSee Also: bash-first-run-notice.txt”

bash-first-run-notice.txt#
πŸ‘‹  Welcome to the `scikit-plots` Dev Environment (Docker / Codespaces)

🧭  Quick Navigation:
β€’ πŸ”Ž  Open the Command Palette β†’ `Ctrl+Shift+P` / `Cmd+Shift+P` or `F1`
β€’ πŸ“˜  Quick Start β†’ https://scikit-plots.github.io/dev/introduction/quick_start.html
β€’ πŸ› οΈ  Dev Guide β†’ https://scikit-plots.github.io/dev/devel/index.html

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⭐ 🌟  IMPORTANT: Complete Environment Setup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

βœ…  Check Installation:
  $ scikitplot -V
  $ python -c "import scikitplot; scikitplot.show_config()"

βœ…  Post-Create Setup (Recommended):
  $ bash docker/scripts/all_post_create.sh

βœ…  Safe Git Configs:
  $ git config --global --add safe.directory '*'
  $ git submodule update --init
  $ git remote add upstream https://github.com/scikit-plots/scikit-plots.git
  $ git fetch upstream --tags

βœ…  Create Environment (Micromamba/Conda):
  $ mamba create -n py311 python=3.11 ipykernel -y
  $ conda create -n py311 python=3.11 ipykernel -y
  $ conda activate py311

βœ…  Install Dependencies:
  $ pip install -r requirements/all.txt
  $ pre-commit install
  $ pip install --no-build-isolation --no-cache-dir -e .

βœ…  (Optional) Install CPU-specific packages:
  $ pip install -r requirements/cpu.txt

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“¦  Environment Management Notes:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

β€’ Activate environments (depending on tool):
  $ conda activate py311
  $ micromamba activate py311

β€’ See environments:
  $ conda info -e
  $ micromamba info -e

β€’ Initialize Conda shell support (if needed):
  $ conda init

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ’‘  Troubleshooting:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

β€’ πŸ’½  Disk Space:
  $ df -h && du -h --max-depth=1

β€’ πŸ’Ύ  Creation logs (Codespaces):
  ⚠️ πŸ‘‡ Check Codespace Container creation raise `ERROR: ... : No space left on device`
  $ cat /workspaces/.codespaces/.persistedshare/creation.log

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✍  Starting Development
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🌿  Create a new branch before working:
  $ git checkout -b feature/my-new-feature

✍  Proceed to create a branch if you have uncommitted changes and are beginning work on a new feature or bug fix.
πŸ”„  Read more: https://scikit-plots.github.io/dev/devel/quickstart_contributing.html#creating-a-branch

🚯 Stop Containers#

docker compose down

🐳 Docker Compose Configuration#

This project is based on Docker Compose and includes multiple services:

πŸ”Ή scikit-plots_latest-jupyter (CPU-Only)

Runs Jupyter Notebook using jupyter/tensorflow-notebook:latest

No CUDA support, best for lightweight tasks

Mounts the local folder scikit-plots to /home/jovyan/work

Runs on port 8888

πŸ”Ή app_nvidia_host_gpu_driver (Uses Host CUDA)

Runs Jupyter Notebook using jupyter/tensorflow-notebook:latest

Uses host-installed CUDA for GPU acceleration

Requires NVIDIA runtime enabled (–runtime=nvidia)

Runs on port 8889

πŸ”Ή app_nvidia_internal_gpu_driver (CUDA Inside Container)

Runs nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04 with pre-installed CUDA

Includes NVIDIA GPU support without needing host CUDA

Requires NVIDIA runtime (–runtime=nvidia)

Runs on port 8890

πŸ› οΈ Custom Docker Commands#

If you need more control, you can use Docker CLI commands.

▢️ Build & Run the Container Manually

docker build -t my-custom-container -f docker/Dockerfile .
docker run -it --rm -p 8888:8888 my-custom-container

▢️ Check GPU Availability Inside Container

docker exec -it <container_id> nvidia-smi

πŸ“‚ Folder Structure#

docker/
β”œβ”€β”€ docker-compose.yml              # Primary Docker Compose file
β”œβ”€β”€ docker-compose.override.yml     # Optional override file (auto-included if present)
β”œβ”€β”€ Dockerfile                      # Custom Dockerfile
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ install_gpu_nvidia_cuda.sh  # GPU setup scripts

πŸ–₯️ Useful References#

πŸ“š Jupyter Docker Stacks: Read the Docs

πŸ“š Docker Compose: Official Docs

πŸ“š Dockerfile Best Practices

πŸ“š LocalStack Installation with Docker Compose

πŸ“š NVIDIA CUDA in Containers: NVIDIA Docs

https://developer-blogs.nvidia.com/wp-content/uploads/2016/06/nvidia-docker.png

πŸš€ Now you’re ready to run Jupyter notebooks in Docker! 😊