TOOL WIKI · RUNTIME & DEPLOYMENT
Docker
Packages application code and dependencies into containerized environments.
Jump to a section 10 sections
EXAMPLE USE CASE
Package a minimal order-status service in a container
A developer needs a concrete execution environment for a background task, browser operation or service, with a visible terminal result.
- Input
- The supplied Dockerfile and Python health/order HTTP endpoints.
- Expected output
- A running non-root container returning health ok and A104 packed.
- Success check: The health endpoint returns ok and the order endpoint returns packed.
- Try a failure: An unknown route must return a real 404; inspect container readiness separately from image build success.
Example scope: Actual service packaging baseline; no model inference or production authentication is included.
Set the allowed runtime, network access, credentials, and maximum duration.
inputTo 02 · DockerDeploying an agent service with a reproducible application environment. A container still needs deliberate resource, privilege, and network policy.
processTo 03 · Worker environmentRun only the workload and dependencies required for the task.
Check permissions at each resource service and reconcile uncertain writes.
Inspect files, records, and task-level acceptance criteria.
outputTo 06 · LifecycleRetain required artifacts, release temporary compute, and expire task credentials.
Result or stopping point
Deploying an agent service with a reproducible application environment. A container still needs deliberate resource, privilege, and network policy.
When to consider it
- Deploying an agent service with a reproducible application environment.
A design decision to make
- A container still needs deliberate resource, privilege, and network policy.
Prerequisites and setup
- Docker. Save both files in container-demo before building. This is a runtime fixture, not a production HTTP framework.
mkdir -p container-demoTry a small integration
container-demo/Dockerfile
FROM python:3.13-slim
WORKDIR /app
COPY app.py /app/app.py
USER 10001:10001
EXPOSE 8080
CMD ["python", "app.py"]container-demo/app.py
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == "/health":
payload, status = {"ok":True}, 200
elif self.path == "/orders/A104":
payload, status = {"order_id":"A104","status":"packed"}, 200
else:
payload, status = {"error":"not_found"}, 404
data = json.dumps(payload).encode()
self.send_response(status)
self.send_header("Content-Type","application/json")
self.send_header("Content-Length",str(len(data)))
self.end_headers()
self.wfile.write(data)
HTTPServer(("0.0.0.0",8080),Handler).serve_forever()Run and check the result
docker build -t asg-agent-lab ./container-demo
docker run --rm --name asg-agent-lab --read-only --cap-drop=ALL \
--security-opt=no-new-privileges --memory=128m --cpus=0.5 \
-p 127.0.0.1:8088:8080 asg-agent-lab
# In a second terminal:
curl --fail http://localhost:8088/health
curl --fail http://localhost:8088/orders/A104- The health endpoint returns ok and the order endpoint returns packed.
- The process runs without root, with a read-only filesystem and explicit CPU/memory limits.
Common failures
- A worker accepting a job does not establish completion. Inspect the task result, failure and retry history.
- Do not expose a development control plane or unauthenticated execution endpoint publicly.
Production decisions
- Use bounded CPU/memory/time, restricted filesystem mounts and network access, short-lived secrets and per-user isolation.
- Preserve run/operation identifiers, cancellation and terminal states. Retryable remote writes need provider idempotency or reconciliation.
- Pin image digests, scan dependencies, use a production server and inject credentials at runtime rather than baking them into image layers.
Keep exploring
Explore the same layer
Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.