Background
Docker Model Runner (introduced in Docker Desktop 4.40 / Docker Engine 2025) allows running LLMs locally via Docker with a single command:
docker model run ai/smollm2
It exposes an OpenAI-compatible API on localhost, making models available to any tool that speaks the OpenAI protocol.
Why This Makes Sense for DockSec
- Docker is already a hard dependency of DockSec — users have it installed by definition
- Adds a fully air-gapped mode: scan and analyze with zero external API calls
- "Use Docker to secure Docker" is a clean story for the OWASP and Docker communities
- OpenAI-compatible API means the integration is minimal — similar to the existing Ollama provider
- Differentiates DockSec from generic security scanners
Proposed Usage
# Start a model via Docker Model Runner
docker model run ai/smollm2
# Use it in DockSec
docksec Dockerfile -i myapp:latest --provider docker-model-runner --model ai/smollm2
# Or via environment variable
LLM_PROVIDER=docker-model-runner LLM_MODEL=ai/smollm2 docksec Dockerfile -i myapp:latest
Implementation Plan
1. Add provider to utils.py get_llm()
Docker Model Runner exposes an OpenAI-compatible API, so it can use ChatOpenAI with a custom base_url:
elif provider == "docker-model-runner":
llm = ChatOpenAI(
model=model,
base_url="http://localhost:12434/engines/llama.cpp/v1",
api_key="no-key-required",
temperature=temperature,
request_timeout=timeout,
max_retries=max_retries
)
return llm
2. Update config_manager.py
Add docker-model-runner to the valid provider list and document the default base URL.
3. Update docksec.py argparse choices
parser.add_argument(
'--provider',
choices=['openai', 'anthropic', 'google', 'ollama', 'docker-model-runner'],
...
)
4. Update setup_external_tools.py
Add a check that verifies Docker Model Runner is available:
def check_docker_model_runner():
result = subprocess.run(
["docker", "model", "list"],
capture_output=True, text=True
)
return result.returncode == 0
5. Update README
Add Docker Model Runner to the supported LLM providers table with setup instructions.
Requirements
- Docker Desktop 4.40+ or Docker Engine with model runner support
- No API key needed
- Model must be pulled before use:
docker model pull ai/smollm2
Useful Models to Test With
| Model |
Command |
| SmolLM2 |
docker model pull ai/smollm2 |
| Llama 3.2 |
docker model pull ai/llama3.2 |
| Phi-3 |
docker model pull ai/phi3 |
References
Acceptance Criteria
Background
Docker Model Runner (introduced in Docker Desktop 4.40 / Docker Engine 2025) allows running LLMs locally via Docker with a single command:
It exposes an OpenAI-compatible API on localhost, making models available to any tool that speaks the OpenAI protocol.
Why This Makes Sense for DockSec
Proposed Usage
Implementation Plan
1. Add provider to
utils.pyget_llm()Docker Model Runner exposes an OpenAI-compatible API, so it can use
ChatOpenAIwith a custombase_url:2. Update
config_manager.pyAdd
docker-model-runnerto the valid provider list and document the default base URL.3. Update
docksec.pyargparse choices4. Update
setup_external_tools.pyAdd a check that verifies Docker Model Runner is available:
5. Update README
Add Docker Model Runner to the supported LLM providers table with setup instructions.
Requirements
docker model pull ai/smollm2Useful Models to Test With
docker model pull ai/smollm2docker model pull ai/llama3.2docker model pull ai/phi3References
Acceptance Criteria
--provider docker-model-runnerworks end-to-endtest_utils.py