- Home
- Skills
- DevOps & Cloud
- Dockerize by Observation
More screenshots
Works with the AI Agents you already use
Dockerize by Observation
Containerize an existing app by watching it run: trace the files, libraries, ports and services it really uses, generate an annotated Dockerfile and Compose setup, then prove the container behaves the same.
$7
Dockerize by Observation
Example session with this skill installed
Dockerize this Django app (healthchecks). It runs on my machine with bash -c "python manage.py migrate --noinput && python manage.py runserver --noreload 0.0.0.0:8000" against my local PostgreSQL. Use bash workload.sh as the workload; it hits the main pages and the API.
- Read your context and instructions
- Compiled the dockerize by observation
Traced healthchecks on the host with your workload, generated the Docker files from what it actually did, then rebuilt and re-traced it inside the container.
RESULT: PASS — verified for the features workload.sh exercised.
What I generated
| File | What's in it |
|---|---|
Dockerfile | Every line cites its evidence (Python version, OS libraries, port, start command) |
docker-compose.yml | App + a postgres service, because the app connected to 127.0.0.1:5432 |
.env.example | Settings found in the source; secrets and the database password left blank |
OBSERVATIONS.md | What was observed, and what needs your decision |
.dockerignore | Keeps .imprint/, .git and venvs out of the image |
Dockerfile (excerpt)
# observed: Python 3.13.5 ran the app
FROM python:3.13-slim
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
# libldap2: used liblber.so.2.0.200, libldap.so.2.0.200
# libpq5: used libpq.so.5.17
# libsasl2-2: used libsasl2.so.2.0.25
RUN apt-get update && apt-get install -y --no-install-recommends \
libldap2 libpq5 libsasl2-2 \
&& find /var/lib/apt/lists -type f -delete
WORKDIR /app
# declared deps; trace confirmed 24 packages in use
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN useradd --create-home --uid 1000 app && chown -R app /app
# observed: listened on 0.0.0.0:8000
EXPOSE 8000
USER app
# observed launch command
CMD ["bash", "-c", "python manage.py migrate --noinput >/dev/null && exec python manage.py runserver --noreload 0.0.0.0:8000"]
libpq5 is the key find: psycopg loads libpq at runtime, and nothing in requirements.txt says so.
Verification
Parity: 1383/1386 files the app used on the host were used in the container (100%).
Ports: host [8000] / container [8000]
Workload exit: host 0 / container 0
Not touched in container (3): lib:libexpat.so, py:pip-25.1.1.dist-info/entry_points.txt, pystd:sitecustomize.py
RESULT: PASS
Every request in the workload returned the same status code on both sides.
Needs your review
Secrets: fill DB_PASSWORD, SECRET_KEY and POSTGRES_PASSWORD in .env; they are never written into the image, and Compose won't start the database without a password.
- Start command: the app was launched through
bash; consider running the real process directly as CMD.
Writable file: the app writes search.db at the top level. If it must survive restarts, move it to a directory and mount a volume.
Coverage gap: minismtpd is declared but was never loaded during the trace. It's kept in the image; extend the workload if it matters.
- Postgres version: the Compose file uses
postgres:16; match your local major version.
Next steps
cp .env.example .envand fill in the secrets.docker compose up --build- Add any features the workload skipped to
workload.shand re-run verify.
Connects securely to your tools. The creator never sees your data.
About this skill
Containerizing legacy or undocumented applications often involves hours of trial-and-error, guessing dependencies, and fixing "works on my machine" bugs. This skill eliminates the guesswork by observing your application while it runs, recording exactly which files, libraries, and system packages it touches to generate an evidence-based Docker configuration.
What it does
- Trace execution by using
straceto log every system call, file access, and network bind during a live run or test suite. - Map dependencies by resolving observed file paths to specific OS packages, language-specific runtimes, and third-party libraries.
- Generate artifacts including an annotated
Dockerfile,docker-compose.yml,.env.example, and.dockerignorebased on runtime data. - Verify parity by building the image and re-running the same workload inside the container to compare execution traces and ensure functional equivalence.
- Detect configuration by identifying environment variables, listening ports, and required backing services like Redis or PostgreSQL.
How it works
- Host Trace: You provide the start command and a workload (like a smoke-test script or test suite); the skill traces the app on your host machine.
- Analysis: The skill maps the trace report to a deployment plan, identifying missing packages and hard-coded localhost binds.
- Scaffolding: It generates the Docker assets, adding comments to every instruction explaining which observed evidence required that line.
- Validation: It runs a verification suite that builds the image and compares the containerized behavior against the host trace to identify missing files.
Security by default
- Secrets are never written into the image or committed files: secret settings and database passwords become blank placeholders in
.env.example, and Compose refuses to start a database without a password. - Credential files the app reads are reported, never copied into the image.
- The raw trace (which contains your environment) is deleted after parsing; the saved report has secrets redacted.
Frameworks & tools
Works on Linux or WSL 2 systems. Built-in templates support Python and Node.js, with generic support for any binary or runtime that can be traced via strace. Uses Docker and Docker Compose for verification.
Why this beats prompting it yourself
Standard prompts rely on the LLM's general knowledge of a framework, often missing niche system libraries or specific version requirements. This skill uses empirical data from your specific environment, ensuring the container includes the exact libfoo.so.1 version your app actually opened.
Use cases
- Legacy migration for apps with no documentation and missing dependency lists.
- Environment parity to fix bugs where the app runs on a dev laptop but fails in CI/CD.
- Sidecar discovery to identify which backing services an app expects to find at runtime.
- Dependency audit with an
OBSERVATIONS.mdlisting the packages, libraries, ports and settings the app really used, plus declared dependencies the workload never loaded (flagged for review, never silently dropped).
Known limitations
Requires a Linux host or WSL 2 with strace installed. Accuracy depends entirely on workload coverage; code paths not exercised during the trace will not be reflected in the dependencies.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.
Requires Linux or WSL 2. One trace session only sees the code paths that ran; coverage gaps lead to missing dependencies. Tailored templates exist for Python and Node.js; other runtimes get a generic Dockerfile to adapt. Apps that need systemd, GPUs, host devices or several cooperating long-running processes need manual design.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Linux only
- Software
Python 3strace
- Optional
Docker (for the build-and-verify step)
On Windows, use WSL 2. Install the strace package with your system package manager (apt, dnf, pacman). Without Docker the files are still generated, but unverified.
Permissions
Terminal: runs strace on the app you name and runs docker build/run for verification. Read/Write files: reads your project and writes the Dockerfile, Compose file, .env.example and a .imprint/ work folder. Network: Docker pulls base images during the build, and your workload talks to the app on localhost. Environment variables: the trace records the traced app's environment to find the settings it uses; secret values are redacted in the saved report and the raw trace is deleted. Nothing is sent anywhere by the skill.