Skip to content

Commit a4c7b7c

Browse files
docs: add --skip-pull flag documentation (#521)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 6e8527e commit a4c7b7c

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

docs/usage.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Options:
3737
See "Agent Image" section for available options
3838
--image-registry <registry> Container image registry (default: ghcr.io/github/gh-aw-firewall)
3939
--image-tag <tag> Container image tag (default: latest)
40+
--skip-pull Use local images without pulling from registry
41+
(requires images to be pre-downloaded)
4042
-V, --version Output the version number
4143
-h, --help Display help for command
4244
@@ -500,6 +502,89 @@ For complete tool listings with versions, see [Agent Image Tools Reference](/gh-
500502
- Subsequent builds use Docker cache and are faster
501503
- The `full-XX.XX` images require significant disk space (~60GB extracted)
502504

505+
## Using Pre-Downloaded Images
506+
507+
For offline environments, air-gapped systems, or CI pipelines with image caching, you can use the `--skip-pull` flag to prevent awf from pulling images from the registry. This requires images to be pre-downloaded locally.
508+
509+
### Basic Usage
510+
511+
```bash
512+
# Pre-download images first
513+
docker pull ghcr.io/github/gh-aw-firewall/squid:latest
514+
docker pull ghcr.io/github/gh-aw-firewall/agent:latest
515+
516+
# Use pre-downloaded images without pulling
517+
sudo awf --skip-pull --allow-domains github.com -- curl https://api.github.com
518+
```
519+
520+
### Use Cases
521+
522+
**Offline/Air-Gapped Environments:**
523+
```bash
524+
# Download images on a connected machine
525+
docker pull ghcr.io/github/gh-aw-firewall/squid:latest
526+
docker pull ghcr.io/github/gh-aw-firewall/agent:latest
527+
docker save ghcr.io/github/gh-aw-firewall/squid:latest > squid.tar
528+
docker save ghcr.io/github/gh-aw-firewall/agent:latest > agent.tar
529+
530+
# Transfer tar files to air-gapped system, then:
531+
docker load < squid.tar
532+
docker load < agent.tar
533+
534+
# Run without network access to registry
535+
sudo awf --skip-pull --allow-domains github.com -- your-command
536+
```
537+
538+
**CI Pipeline Image Caching:**
539+
```yaml
540+
# GitHub Actions example
541+
- name: Cache Docker images
542+
uses: actions/cache@v4
543+
with:
544+
path: /var/lib/docker
545+
key: docker-images-${{ hashFiles('**/Dockerfile') }}
546+
547+
- name: Pre-pull images (only if cache miss)
548+
if: steps.cache.outputs.cache-hit != 'true'
549+
run: |
550+
docker pull ghcr.io/github/gh-aw-firewall/squid:latest
551+
docker pull ghcr.io/github/gh-aw-firewall/agent:latest
552+
553+
- name: Run awf with cached images
554+
run: |
555+
sudo awf --skip-pull --allow-domains github.com -- your-command
556+
```
557+
558+
**Using Specific Versions:**
559+
```bash
560+
# Pre-download specific version
561+
docker pull ghcr.io/github/gh-aw-firewall/squid:v0.13.0
562+
docker pull ghcr.io/github/gh-aw-firewall/agent:v0.13.0
563+
564+
# Tag as latest for awf to use
565+
docker tag ghcr.io/github/gh-aw-firewall/squid:v0.13.0 ghcr.io/github/gh-aw-firewall/squid:latest
566+
docker tag ghcr.io/github/gh-aw-firewall/agent:v0.13.0 ghcr.io/github/gh-aw-firewall/agent:latest
567+
568+
# Use with --skip-pull
569+
sudo awf --skip-pull --allow-domains github.com -- your-command
570+
```
571+
572+
### Important Notes
573+
574+
- **Images must be pre-downloaded**: Using `--skip-pull` without having the required images will cause Docker to fail
575+
- **Version compatibility**: Ensure pre-downloaded image versions match the awf version you're using
576+
- **Not compatible with --build-local**: The `--skip-pull` flag cannot be used with `--build-local` since building requires pulling base images
577+
- **Default images only**: This works with preset images (`default`, `act`). Custom base images require `--build-local` and cannot use `--skip-pull`
578+
579+
### Error Handling
580+
581+
If images are not available locally when using `--skip-pull`, you'll see an error like:
582+
```
583+
Error: unable to find image 'ghcr.io/github/gh-aw-firewall/agent:latest' locally
584+
```
585+
586+
To fix this, remove `--skip-pull` to allow automatic pulling, or pre-download the images first.
587+
503588
## Chroot Mode
504589

505590
The `--enable-chroot` flag enables transparent access to host binaries (Python, Node.js, Go, etc.) while maintaining network isolation. This is useful for GitHub Actions runners with pre-installed tools.

0 commit comments

Comments
 (0)