Skip to content

Commit 9a4adf4

Browse files
committed
add guide for adding ci dockerfiles to support more distributions
motivation: easier contribution changes: add a readme in the swift-ci area to explain how the ci docker setup works and how to contribute
1 parent 17a9e2f commit 9a4adf4

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img src="https://swift.org/assets/images/swift.svg" alt="Swift logo" height="70" >
44

5-
### An Ubuntu 16.04 and Ubuntu 18.04 Docker image for [Swift](https://swift.org).
5+
### Docker images for [Swift](https://swift.org).
66

77
#### You can find the Docker Hub repo here: [https://hub.docker.com/_/swift/](https://hub.docker.com/_/swift/)
88

swift-ci/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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

Comments
 (0)