Kaggle Notebooks allow users to run a Python Notebook in the cloud against our competitions and datasets without having to download data or set up their environment.
This repository includes the Dockerfile for building the CPU-only and GPU image that runs Python Notebooks on Kaggle.
Our Python Docker images are stored on the Google Container Registry at:
First, evaluate whether installing the package yourself in your own notebooks suits your needs. See guide.
If you the first step above doesn't work for your use case, open an issue or a pull request.
./build
Flags:
--gpu to build an image for GPU.--use-cache for faster iterative builds.A suite of tests can be found under the /tests folder. You can run the test using this command:
./test
Flags:
--gpu to test the GPU image.--pattern test_keras.py or -p test_keras.py to run a single test--image gcr.io/kaggle-images/python:ci-pretest or -i gcr.io/kaggle-images/python:ci-pretest to test against a specific imageFor the CPU-only image:
# Run the image built locally:
docker run --rm -it kaggle/python-build /bin/bash
# Run the pre-built image from gcr.io
docker run --rm -it gcr.io/kaggle-images/python /bin/bash
For the GPU image:
# Run the image built locally:
docker run --runtime nvidia --rm -it kaggle/python-gpu-build /bin/bash
# Run the image pre-built image from gcr.io
docker run --runtime nvidia --rm -it gcr.io/kaggle-gpu-images/python /bin/bash
To ensure your container can access the GPU, follow the instructions posted here.
1,039 followers · starred Oct 2025
22 followers · starred Jun 2018
335 followers · starred Apr 2017
986 followers · starred Dec 2025
Kaggle Notebooks allow users to run a Python Notebook in the cloud against our competitions and datasets without having to download data or set up their environment.
This repository includes the Dockerfile for building the CPU-only and GPU image that runs Python Notebooks on Kaggle.
Our Python Docker images are stored on the Google Container Registry at:
First, evaluate whether installing the package yourself in your own notebooks suits your needs. See guide.
If you the first step above doesn't work for your use case, open an issue or a pull request.
./build
Flags:
--gpu to build an image for GPU.--use-cache for faster iterative builds.A suite of tests can be found under the /tests folder. You can run the test using this command:
./test
Flags:
--gpu to test the GPU image.--pattern test_keras.py or -p test_keras.py to run a single test--image gcr.io/kaggle-images/python:ci-pretest or -i gcr.io/kaggle-images/python:ci-pretest to test against a specific imageFor the CPU-only image:
# Run the image built locally:
docker run --rm -it kaggle/python-build /bin/bash
# Run the pre-built image from gcr.io
docker run --rm -it gcr.io/kaggle-images/python /bin/bash
For the GPU image:
# Run the image built locally:
docker run --runtime nvidia --rm -it kaggle/python-gpu-build /bin/bash
# Run the image pre-built image from gcr.io
docker run --runtime nvidia --rm -it gcr.io/kaggle-gpu-images/python /bin/bash
To ensure your container can access the GPU, follow the instructions posted here.
1,039 followers · starred Oct 2025
22 followers · starred Jun 2018
335 followers · starred Apr 2017
986 followers · starred Dec 2025