Skip to content

Commit d0a5dfd

Browse files
committed
Improve documentation around labels and use in CI
1 parent 5c3dc8d commit d0a5dfd

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,20 @@ v14.21.3
9696
A variant of the image is published on GitHub Container Registry as
9797
[`ghcr.io/trailofbits/eth-security-toolbox/ci`](https://github.com/trailofbits/eth-security-toolbox/pkgs/container/eth-security-toolbox%2Fci).
9898
This variant is meant to be slightly lighter, and better suited for its use in
99-
CI contexts such as [GitHub workflow jobs](https://docs.github.com/en/actions/writing-workflows/choosing-where-your-workflow-runs/running-jobs-in-a-container).
99+
CI contexts such as [GitHub workflow jobs](https://docs.github.com/en/actions/writing-workflows/choosing-where-your-workflow-runs/running-jobs-in-a-container):
100+
101+
102+
```yaml
103+
# workflow triggers, ...
104+
105+
jobs:
106+
tests:
107+
runs-on: ubuntu-latest
108+
container: ghcr.io/trailofbits/eth-security-toolbox/ci:nightly
109+
steps:
110+
# other steps ...
111+
- run: medusa fuzz # or any tool from the image
112+
```
100113
101114
The main differences are:
102115
* The container does not have a dedicated non-root user. All tools are
@@ -106,6 +119,31 @@ The main differences are:
106119
install any binaries you may need.
107120
* pyevmasm and the building secure contracts repository are not included.
108121

122+
## Container image labels
123+
124+
Both `eth-security-toolbox` and `eth-security-toolbox/ci` use the following
125+
label convention:
126+
127+
| Label | Description
128+
|--------------------|--------------------------------------------------------
129+
| `nightly-YYYYMMDD` | Image built from the code in `master` on day YYYY-MM-DD
130+
| `nightly` | Alias for the latest `nightly-YYYYMMDD` container image
131+
| `testing-BRANCH` | Image built when the tip of `BRANCH` was last updated
132+
| `edge` | Alias for `testing-master`
133+
| `TAG` | Image built when `TAG` was tagged
134+
| `latest` | Alias for the latest `TAG` container image
135+
136+
To keep tooling in CI predictable, we recommend picking a `nightly-YYYYMMDD`
137+
image and pinning it by hash on your workflow file. Then, establish a process
138+
to review the changes and update the container reference on a regular cadence,
139+
so that you can continue to benefit from tool improvements. The following
140+
snippet shows the syntax used to pin the image on a GitHub Actions workflow;
141+
the hashes may be obtained from the [container registry page](https://github.com/orgs/trailofbits/packages?repo_name=eth-security-toolbox).
142+
143+
```yaml
144+
container: ghcr.io/trailofbits/eth-security-toolbox/ci:nightly-YYYYMMDD@sha256:HASH_GOES_HERE
145+
```
146+
109147
## Getting Help
110148

111149
Feel free to stop by our [Slack channel](https://slack.empirehacking.nyc/) for

0 commit comments

Comments
 (0)