This repository provides a minimal, customizable Docker image for PyTorch, suitable for various Python, CUDA, and PyTorch versions. The image is built and pushed to Docker Hub automatically using GitHub Actions.
- Python: 3.12
- CUDA: 12.4
- PyTorch: Latest compatible version with the above CUDA version
Modify package lists in the requirements
folder:
packages.txt
: Standard pip packages installed viapip install -r
.torch_extensions.txt
: PyTorch extensions installed with--no-build-isolation
.
Adjust the FROM
directive and ARGS
in the Dockerfile to change the base OS, CUDA, and PyTorch versions.
- Set GitHub Secrets:
- Navigate to your repository's Settings.
- Go to Secrets and add the following:
DOCKERHUB_USERNAME
: Your Docker Hub username.DOCKERHUB_TOKEN
: Your Docker Hub access token.
- Create a Release:
- Push your changes to the main branch.
- Go to the "Releases" section in your GitHub repository.
- Click "Create a new release".
- Tag your release and publish it.
Upon publishing a release, the workflow is triggered, building and pushing the image to Docker Hub with latest
and the release tag.