You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-6Lines changed: 68 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,77 @@
17
17
18
18
# [linuxserver/ci][huburl]
19
19
20
-
**This container is not meant for public consumption as it is hard coded to LinuxServer endpoints for storage of resulting reports**
20
+
## What is this?
21
21
22
-
The purpose of this container is to accept environment variables from our build system [linuxserver/pipeline-triggers][pipelineurl] to perform basic continuous integration on the software being built.
22
+
This container is an automated testing tool for Docker images. It's designed to perform a series of checks to ensure a container is healthy and functional before it's released. Here's what it does:
23
23
24
-
## Usage
24
+
1.**Spins up the container:** It runs the target Docker image with a specified tag.
25
+
2.**Checks for successful startup:** It tails the container's logs, waiting for the `[services.d] done.` message, which confirms the init system has finished and the services are running.
26
+
3.**Generates an SBOM:** It uses `syft` to create a Software Bill of Materials, providing a complete list of all packages inside the image.
27
+
4.**Tests the Web UI (optional):** If the container runs a web service, it attempts to connect to the UI and take a screenshot to verify it's accessible and renders correctly.
28
+
5.**Generates a report:** It gathers all the results—container logs, build info, SBOM, screenshots, and test statuses—into a comprehensive HTML report.
29
+
6.**Uploads the report (CI only):** In a CI environment, it uploads the final report to an S3 bucket for review.
25
30
26
-
The container can be run locally, but it is meant to be integrated into the LinuxServer build process:
31
+
## Developer Mode (Local Testing)
27
32
28
-
```
33
+
For local development and debugging, you can use `CI_LOCAL_MODE`. This mode runs all the tests but skips the S3 upload, saving the report directly to a local folder. It's the easiest way to test a container without needing cloud credentials.
34
+
35
+
### Example Run Command
36
+
37
+
Run this command from your terminal. It will test the `linuxserver/plex:latest` image and place the report in an `output` directory in your current folder.
38
+
39
+
|||
40
+
docker run --rm -i \
41
+
--shm-size=1gb \
42
+
-v /var/run/docker.sock:/var/run/docker.sock \
43
+
-v "$(pwd)/output:/ci/output" \
44
+
-e CI_LOCAL_MODE=true \
45
+
-e IMAGE="linuxserver/plex" \
46
+
-e TAGS="latest" \
47
+
-e BASE="ubuntu" \
48
+
-e WEB_SCREENSHOT=true \
49
+
-e PORT=32400 \
50
+
-e SSL=false \
51
+
-e WEB_PATH="/web/index.html" \
52
+
-e WEB_AUTH="" \
53
+
-e WEB_SCREENSHOT_TIMEOUT=60 \
54
+
-e WEB_SCREENSHOT_DELAY=20 \
55
+
-t lsiodev/ci:latest\
56
+
python3 test_build.py
57
+
|||
58
+
59
+
### Viewing the Report
60
+
61
+
Once the script finishes, you can view the detailed HTML report with this command:
> **Note:** You can use any modern web browser (Firefox, Chrome, etc.).
67
+
68
+
### Key Local Variables
69
+
70
+
| Variable | Description | Example |
71
+
| :--- | :--- | :--- |
72
+
|`CI_LOCAL_MODE`|**Required.** Enables local mode, disables S3 uploads. |`true`|
73
+
|`IMAGE`|**Required.** The full name of the image to test. |`linuxserver/plex`|
74
+
|`TAGS`|**Required.** The tag(s) to test. Use `\|` to separate multiple tags. |`latest`|
75
+
|`BASE`|**Required.** The base distribution of the image. |`ubuntu` or `alpine`|
76
+
|`WEB_SCREENSHOT`| Set to `true` to enable screenshot testing for web UIs. |`true`|
77
+
|`PORT`| The internal port the web UI listens on. |`32400`|
78
+
|`SSL`| Set to `true` if the web UI uses `https://`. |`false`|
79
+
|`WEB_PATH`| The specific path to the web UI landing page. |`/web/index.html`|
80
+
|`WEB_AUTH`| Credentials for basic auth, format `user:password`. Leave empty for none. |`""`|
81
+
|`WEB_SCREENSHOT_DELAY`| Seconds to wait after the page loads before taking the screenshot. |`20`|
82
+
83
+
84
+
## Advanced Usage (CI Environment)
85
+
86
+
**This container is not meant for public consumption as it is hard coded to LinuxServer endpoints for storage of resulting reports.**
87
+
88
+
The following shows the full list of environment variables used when the container is run by our CI system, [linuxserver/pipeline-triggers][pipelineurl].
89
+
90
+
|||
29
91
sudo docker run --rm -i \
30
92
-v /var/run/docker.sock:/var/run/docker.sock \
31
93
-v /host/path:/ci/output:rw`#Optional, will contain all the files the container creates.`\
@@ -55,7 +117,7 @@ sudo docker run --rm -i \
55
117
-e SYFT_IMAGE_TAG=<optional, The image tag of the syft docker image. Used for generating SBOM. Defaults to '1.26.1'> \
56
118
-t lsiodev/ci:latest\
57
119
python3 test_build.py
58
-
```
120
+
|||
59
121
60
122
The following line is only in this repo for loop testing:
Copy file name to clipboardExpand all lines: readme-vars.yml
+68-6Lines changed: 68 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -22,15 +22,77 @@ full_custom_readme: |
22
22
23
23
# [linuxserver/ci][huburl]
24
24
25
-
**This container is not meant for public consumption as it is hard coded to LinuxServer endpoints for storage of resulting reports**
25
+
## What is this?
26
26
27
-
The purpose of this container is to accept environment variables from our build system [linuxserver/pipeline-triggers][pipelineurl] to perform basic continuous integration on the software being built.
27
+
This container is an automated testing tool for Docker images. It's designed to perform a series of checks to ensure a container is healthy and functional before it's released. Here's what it does:
28
28
29
-
## Usage
29
+
1. **Spins up the container:** It runs the target Docker image with a specified tag.
30
+
2. **Checks for successful startup:** It tails the container's logs, waiting for the `[services.d] done.` message, which confirms the init system has finished and the services are running.
31
+
3. **Generates an SBOM:** It uses `syft` to create a Software Bill of Materials, providing a complete list of all packages inside the image.
32
+
4. **Tests the Web UI (optional):** If the container runs a web service, it attempts to connect to the UI and take a screenshot to verify it's accessible and renders correctly.
33
+
5. **Generates a report:** It gathers all the results—container logs, build info, SBOM, screenshots, and test statuses—into a comprehensive HTML report.
34
+
6. **Uploads the report (CI only):** In a CI environment, it uploads the final report to an S3 bucket for review.
30
35
31
-
The container can be run locally, but it is meant to be integrated into the LinuxServer build process:
36
+
## Developer Mode (Local Testing)
32
37
33
-
```
38
+
For local development and debugging, you can use `CI_LOCAL_MODE`. This mode runs all the tests but skips the S3 upload, saving the report directly to a local folder. It's the easiest way to test a container without needing cloud credentials.
39
+
40
+
### Example Run Command
41
+
42
+
Run this command from your terminal. It will test the `linuxserver/plex:latest` image and place the report in an `output` directory in your current folder.
43
+
44
+
|||
45
+
docker run --rm -i \
46
+
--shm-size=1gb \
47
+
-v /var/run/docker.sock:/var/run/docker.sock \
48
+
-v "$(pwd)/output:/ci/output" \
49
+
-e CI_LOCAL_MODE=true \
50
+
-e IMAGE="linuxserver/plex" \
51
+
-e TAGS="latest" \
52
+
-e BASE="ubuntu" \
53
+
-e WEB_SCREENSHOT=true \
54
+
-e PORT=32400 \
55
+
-e SSL=false \
56
+
-e WEB_PATH="/web/index.html" \
57
+
-e WEB_AUTH="" \
58
+
-e WEB_SCREENSHOT_TIMEOUT=60 \
59
+
-e WEB_SCREENSHOT_DELAY=20 \
60
+
-t lsiodev/ci:latest \
61
+
python3 test_build.py
62
+
|||
63
+
64
+
### Viewing the Report
65
+
66
+
Once the script finishes, you can view the detailed HTML report with this command:
| `IMAGE` | **Required.** The full name of the image to test. | `linuxserver/plex` |
79
+
| `TAGS` | **Required.** The tag(s) to test. Use `\|` to separate multiple tags. | `latest` |
80
+
| `BASE` | **Required.** The base distribution of the image. | `ubuntu` or `alpine` |
81
+
| `WEB_SCREENSHOT` | Set to `true` to enable screenshot testing for web UIs. | `true` |
82
+
| `PORT` | The internal port the web UI listens on. | `32400` |
83
+
| `SSL` | Set to `true` if the web UI uses `https://`. | `false` |
84
+
| `WEB_PATH` | The specific path to the web UI landing page. | `/web/index.html` |
85
+
| `WEB_AUTH` | Credentials for basic auth, format `user:password`. Leave empty for none. | `""` |
86
+
| `WEB_SCREENSHOT_DELAY` | Seconds to wait after the page loads before taking the screenshot. | `20` |
87
+
88
+
89
+
## Advanced Usage (CI Environment)
90
+
91
+
**This container is not meant for public consumption as it is hard coded to LinuxServer endpoints for storage of resulting reports.**
92
+
93
+
The following shows the full list of environment variables used when the container is run by our CI system, [linuxserver/pipeline-triggers][pipelineurl].
94
+
95
+
|||
34
96
sudo docker run --rm -i \
35
97
-v /var/run/docker.sock:/var/run/docker.sock \
36
98
-v /host/path:/ci/output:rw `#Optional, will contain all the files the container creates.` \
@@ -60,7 +122,7 @@ full_custom_readme: |
60
122
-e SYFT_IMAGE_TAG=<optional, The image tag of the syft docker image. Used for generating SBOM. Defaults to '1.26.1'> \
61
123
-t lsiodev/ci:latest \
62
124
python3 test_build.py
63
-
```
125
+
|||
64
126
65
127
The following line is only in this repo for loop testing:
0 commit comments