|
| 1 | +### Docker Images for SCR |
| 2 | + |
| 3 | +The Dockerfiles, resulting docker images, and `docker-run-checks.sh` |
| 4 | +script contained herein are used as part of the strategy for CI testing |
| 5 | +of SCR. |
| 6 | + |
| 7 | +Docker is used under CI to speed up deployment of an |
| 8 | +environment with correct build dependencies and to keep a docker |
| 9 | +image deployed at `libscr/scr` DockerHub with latest master build |
| 10 | +(`libscr/scr:latest`) and tagged builds (`scr/SCR:v<tag>`), |
| 11 | +which can be used by other projects to build against the latest |
| 12 | +or a tagged version of SCR. |
| 13 | + |
| 14 | +#### libscr/scr Docker Images |
| 15 | + |
| 16 | +The Dockerfiles `fedora40/Dockerfile`, |
| 17 | +`el9/Dockerfile`, and `alpine/Dockerfile` describe the images built |
| 18 | +under `libscr/scr:fedora40`, `libscr/scr:el9`, and `libscr/scr:alpine` |
| 19 | +respectively, and include the base dependencies required to build SCR. |
| 20 | +The Dockerfiles should be kept up to date for a single point of management. |
| 21 | + |
| 22 | +#### Multiarch Images |
| 23 | + |
| 24 | +Building the images for linux/amd64 and linux/arm64 requires the |
| 25 | +Docker buildx extensions, see |
| 26 | + |
| 27 | + https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ |
| 28 | + |
| 29 | +and run |
| 30 | +``` |
| 31 | +$ docker buildx build --push --platform=linux/arm64,linux/amd64 --tag libscr/scr:el9 -f src/test/docker/el9/Dockerfile . |
| 32 | +``` |
| 33 | + |
| 34 | +to build and push images to docker hub. |
| 35 | + |
| 36 | +#### Local Testing |
| 37 | + |
| 38 | +Developers can test the docker images themselves. If new dependencies are needed, |
| 39 | +they can update the `$image` Dockerfiles manually. |
| 40 | +To create a local Docker image, run the command: |
| 41 | + |
| 42 | +``` |
| 43 | +docker build -t libscr/scr:$image src/test/docker/$image |
| 44 | +``` |
| 45 | + |
| 46 | +To test the locally created image, run: |
| 47 | + |
| 48 | +``` |
| 49 | +src/test/docker/docker-run-checks.sh -i $image [options] -- [arguments] |
| 50 | +``` |
0 commit comments