danielmiessler.fabric/scripts/docker
Kayvan Sylvan 56a1a7f21e fix: verify Go tarball checksums and fix config directory ownership
- Add SHA256 checksum args for amd64 and arm64 Go tarballs
- Verify downloaded Go tarball integrity via `sha256sum -c`
- Remove root-owned `/root/.config/fabric` directory creation
- Create fabric config directory under non-root `appuser` home
- Set proper ownership on `appuser` config directory with `chown`
2026-04-12 21:44:41 -07:00
..
Dockerfile fix: verify Go tarball checksums and fix config directory ownership 2026-04-12 21:44:41 -07:00
README.md ci: harden release pipeline; gate to upstream, migrate tokens, remove docker-on-tag 2025-08-31 07:34:00 -07:00

Fabric Docker Image

This directory provides a simple Docker setup for running the Fabric CLI.

Build

Build the image from the repository root:

docker build -t fabric -f scripts/docker/Dockerfile .

Persisting configuration

Fabric stores its configuration in ~/.config/fabric/.env. Mount this path to keep your settings on the host.

Using a host directory

mkdir -p $HOME/.fabric-config
# Run setup to create the .env and download patterns
 docker run --rm -it -v $HOME/.fabric-config:/root/.config/fabric fabric --setup

Subsequent runs can reuse the same directory:

docker run --rm -it -v $HOME/.fabric-config:/root/.config/fabric fabric -p your-pattern

Mounting a single .env file

If you only want to persist the .env file:

# assuming .env exists in the current directory
docker run --rm -it -v $PWD/.env:/root/.config/fabric/.env fabric -p your-pattern

Running the server

Expose port 8080 to use Fabric's REST API:

docker run --rm -it -p 8080:8080 -v $HOME/.fabric-config:/root/.config/fabric fabric --serve

The API will be available at http://localhost:8080.

Multi-arch builds and GHCR packages

For multi-arch Docker builds (such as those used for GitHub Container Registry packages), the description should be set via annotations in the manifest instead of the Dockerfile LABEL. When building multi-arch images, ensure the build configuration includes:

"annotations": {
  "org.opencontainers.image.description": "A Docker image for running the Fabric CLI. See https://github.com/danielmiessler/Fabric/tree/main/scripts/docker for details."
}

This ensures that GHCR packages display the proper description.