README.md
1# Docker images for GitHub CI and CD
2
3This directory contains everything needed to build the Docker images
4that are used in our CI.
5
6The Dockerfiles located in subdirectories are parameterized to
7conditionally run build stages depending on build arguments passed to
8`docker build`. This lets us use only a few Dockerfiles for many
9images. The different configurations are identified by a freeform
10string that we call a _build environment_. This string is persisted in
11each image as the `BUILD_ENVIRONMENT` environment variable.
12
13See `build.sh` for valid build environments (it's the giant switch).
14
15## Docker CI builds
16
17* `build.sh` -- dispatch script to launch all builds
18* `common` -- scripts used to execute individual Docker build stages
19* `ubuntu` -- Dockerfile for Ubuntu image for CPU build and test jobs
20* `ubuntu-cuda` -- Dockerfile for Ubuntu image with CUDA support for nvidia-docker
21* `ubuntu-rocm` -- Dockerfile for Ubuntu image with ROCm support
22* `ubuntu-xpu` -- Dockerfile for Ubuntu image with XPU support
23
24### Docker CD builds
25
26* `conda` - Dockerfile and build.sh to build Docker images used in nightly conda builds
27* `manywheel` - Dockerfile and build.sh to build Docker images used in nightly manywheel builds
28* `libtorch` - Dockerfile and build.sh to build Docker images used in nightly libtorch builds
29
30## Usage
31
32```bash
33# Build a specific image
34./build.sh pytorch-linux-bionic-py3.8-gcc9 -t myimage:latest
35
36# Set flags (see build.sh) and build image
37sudo bash -c 'PROTOBUF=1 ./build.sh pytorch-linux-bionic-py3.8-gcc9 -t myimage:latest
38```
39