This document explains Docker usage, development workflow, mounted workspaces, and containerized execution for Path Header Scanner.
Path Header Scanner supports:
- direct Docker execution
- Docker Compose
- mounted workspace development
- CI/CD environments
- cross-platform execution
Benefits:
- isolated dependencies
- reproducible environments
- easier onboarding
- portable development workflow
- simplified CI integration
| Concept | Meaning |
|---|---|
| Dockerfile | Build instructions for image creation |
| Image | Packaged application environment |
| Container | Running image instance |
| Docker Compose | Multi-container orchestration |
| Mounted Volume | Shared filesystem between host and container |
| File | Responsibility |
|---|---|
Dockerfile |
Build application image |
docker-compose.yml |
Service orchestration |
Makefile |
Developer workflow shortcuts |
docker build -t path-header-scanner .docker compose builddocker imagesExample:
REPOSITORY TAG IMAGE ID
path-header-scanner latest xxxxxxxxxxxx
docker run -it --rm -w /workspace -v "%cd%:/workspace" path-header-scanner scan appdocker run -it --rm -w /workspace -v "${PWD}:/workspace" path-header-scanner scan appdocker run -it --rm -w /workspace -v "${PWD}:/workspace" path-header-scanner scan appdocker run -it --rm -w /workspace -v "%cd%:/workspace" path-header-scanner scan app --applydocker run -it --rm -w /workspace -v "${PWD}:/workspace" path-header-scanner scan app --applydocker run -it --rm -w /workspace -v "${PWD}:/workspace" path-header-scanner scan app --debugdocker run -it --rm \
-w /workspace \
-v "${PWD}:/workspace" \
path-header-scanner \
scan app --exclude-target-directorydocker run -it --rm \
-w /workspace \
-v "${PWD}:/workspace" \
path-header-scanner \
scan app --include-target-directoryExample:
docker run -it --rm \
-w /workspace \
-v "${PWD}:/workspace" \
path-header-scanner \
scan app --debug| Argument | Purpose |
|---|---|
docker run |
Start container |
-it |
Interactive terminal |
--rm |
Remove container after exit |
-w /workspace |
Set working directory |
-v "${PWD}:/workspace" |
Mount local project |
path-header-scanner |
Docker image name |
scan app |
Scanner command |
--debug |
Enable debug logging |
Using:
-w /workspaceensures:
- relative paths resolve correctly
- mounted workspace becomes runtime root
- simpler CLI commands
- cleaner path handling
Without it:
scan appmay resolve unexpectedly depending on container runtime directory.
The mounted volume:
-v "${PWD}:/workspace"maps:
| Host | Container |
|---|---|
| Local project directory | /workspace |
This means:
- container changes affect local files
- scanner updates local source code directly
- no file copying required
docker compose run --rm \
path-header-scanner \
scan appdocker compose run --rm \
path-header-scanner \
scan app --applydocker compose run --rm \
path-header-scanner \
scan app --debugdocker compose run --rm \
path-header-scanner \
scan app --exclude-target-directorydocker compose run --rm \
path-header-scanner \
bashTypical execution flow:
build image
↓
start container
↓
mount workspace
↓
execute CLI command
↓
modify files
↓
container removed
Typical compose structure:
services:
path-header-scanner:
build: .
working_dir: /workspace
volumes:
- .:/workspaceBenefits:
- reusable configuration
- cleaner commands
- shared team workflow
- easier CI integration
The project uses modular Make helpers for local, Docker, Compose, and published
image execution. Run make help-docker or make help-compose for the current
grouped command reference.
make d-build-allmake d-scan TARGET=appmake d-scan-apply TARGET=appmake d-scan-debug TARGET=appmake c-scan TARGET=srcSee make-workflow.md for all command groups, shared
variables, and published utility image examples.
$(CURDIR) is a GNU Make built-in variable.
Equivalent variables:
| Environment | Variable |
|---|---|
| CMD | %cd% |
| PowerShell | ${PWD} |
| Bash | $PWD |
| Make | $(CURDIR) |
Benefits:
- cross-platform
- shell-independent
- handled directly by Make
Inside Docker:
/workspace
acts as the runtime project root.
Examples:
| Local Path | Container Path |
|---|---|
C:\\project\\app |
/workspace/app |
./src |
/workspace/src |
The scanner supports:
--workdirExample:
path-header-scanner scan src \
--workdir /workspace/projectUseful for:
- monorepos
- nested projects
- custom CI layouts
Recommended modes:
| Mode | Purpose |
|---|---|
| INFO | normal usage |
| DEBUG | troubleshooting |
Debug mode:
--debugshows:
- resolved paths
- runtime directories
- processed files
- diagnostics
- name: Build Docker Image
run: docker build -t path-header-scanner .
- name: Run Scanner
run: |
docker run --rm \
-w /workspace \
-v "${PWD}:/workspace" \
path-header-scanner \
scan appscan:
script:
- docker build -t path-header-scanner .
- >
docker run --rm
-w /workspace
-v "$PWD:/workspace"
path-header-scanner
scan appdocker psdocker imagesdocker rmi path-header-scannerdocker system prune -fLinux/macOS may require:
sudodepending on Docker installation.
Verify volume mount:
-v "${PWD}:/workspace"Ensure:
-w /workspaceis provided.
Build image first:
docker build -t path-header-scanner .Recommended workflow:
- build image once
- use mounted workspace
- use dry-run first
- apply changes afterward
- use Makefile shortcuts
Build image:
make docker-buildDry run:
make docker-scanReview output.
Apply changes:
make docker-apply- Containers are ephemeral when using
--rm. - Mounted volumes allow direct local file updates.
- Docker support is optimized for workspace-based development.
- Relative path handling is designed for mounted environments.
- Docker Compose simplifies team onboarding and CI workflows.
Stable production releases publish four coordinated references to the same
image: exact v1.0.1, minor v1.0, major v1, and latest. Pin CI and
reproducible automation to the immutable exact tag. The other aliases move only
when a compatible stable release is published. Prereleases such as
v1.0.0-rc.1 publish only their exact tag.
See CI/CD and release contract for dynamic registry naming, annotated release tags, provider parity, and stable alias safeguards.