|
| 1 | +# Continuous Integration Docker images |
| 2 | + |
| 3 | +Swift.org uses Docker based virtual build environment to build & qualify Swift toolchains on Linux. |
| 4 | + |
| 5 | +The Continuous Integration system uses the Dockerfiles in this directory to define the virtual build environment, |
| 6 | +then runs the build and qualification steps inside a docker container based on the image. |
| 7 | + |
| 8 | +## Directory Structure |
| 9 | + |
| 10 | +The Dockerfiles used for Continuous Integration are layed out under the top level `swift-ci` directory. |
| 11 | +Under that, we have a directory for each of the target branches, e.g. |
| 12 | +Continuous Integration for Swift's `master` branch uses the `swift-ci/master` Dockerfiles. |
| 13 | + |
| 14 | +## Continuous Integration |
| 15 | + |
| 16 | +This system is designed to support many distributions. |
| 17 | +Once a working Dockerfile is added to this repository, |
| 18 | +we set up Continuous Integration jobs to produce toolchains for the distribution and publish them on Swift.org. |
| 19 | + |
| 20 | +## Local development & testing |
| 21 | + |
| 22 | +First build & tag the Dockerfile: |
| 23 | + |
| 24 | +```bash |
| 25 | +docker build -f <dockerfile path> . -t <some tag> |
| 26 | +``` |
| 27 | + |
| 28 | +Next run the Swift build using that Docker image |
| 29 | + |
| 30 | +```bash |
| 31 | +docker run \ |
| 32 | + --cap-add=SYS_PTRACE \ |
| 33 | + --security-opt seccomp=unconfined \ |
| 34 | + -v <swift source location>:/source \ |
| 35 | + -v <some docker volume name>:/home/build-user \ |
| 36 | + -w /home/build-user/ \ |
| 37 | + <docker image tag from above> \ |
| 38 | + /bin/bash -lc "cp -r /source/* /home/build-user/; ./swift/utils/build-script --preset buildbot_linux" |
| 39 | +``` |
| 40 | + |
| 41 | +## Contributions |
| 42 | + |
| 43 | +Contributions via pull requests are welcome and encouraged :) |
| 44 | + |
| 45 | +Focus on mainstream distributions such as Debian, Ubuntu, Fedora, CentOS, RedHat, etc. |
| 46 | + |
| 47 | +Note that the build must run as non-root user. |
0 commit comments