<p>You correct it: "run that inside the Docker container." Works perfectly. Next turn, it forgets. And so you spend half the session being a human Docker router, translating every command the agent suggests into its <code>docker exec</code> equivalent. It's exhausting in a small, papercut sort of way.</p><p><code>@elyracode/docker</code> is the fix. It teaches Elyra what your containers are from the moment a session starts, so you can stop being the middleman.</p><h2>Install</h2><pre><code>elyra install npm:@elyracode/docker
</code></pre><p>You need the Docker CLI. That's it.</p><h2>What happens when a session starts</h2><p>The extension reads your <code>docker-compose.yml</code> (or <code>compose.yml</code>), sees which containers are running, and quietly slides that context into the system prompt:</p><pre><code class="language-yaml"># The agent now knows:
# - Which services exist (app, db, redis, nginx)
# - Which ports are mapped (8000:80, 3306:3306)
# - Which volumes are mounted
# - Which containers are currently running
</code></pre><p>From here on, commands that belong inside a container go inside a container. You don't have to ask, remind, or nudge.</p><h2>Container exec</h2><p>This is the heart of it. When the agent needs to run something, it runs it in the right place:</p><pre><code>Run the database migrations
</code></pre><p>The agent calls <code>docker_exec</code> against the app container with <code>php artisan migrate</code>. Not on your host. Inside the container where PHP, Composer, and the database connection actually live.</p><p>A few more examples that should feel familiar:</p><pre><code>Run the test suite
</code></pre><pre><code>Check what Node version is in the frontend container
</code></pre><pre><code>Install the missing Composer package
</code></pre><pre><code>Clear the application cache
</code></pre><p>You can be explicit when you need to be:</p><pre><code>Run "redis-cli FLUSHALL" in the redis container
</code></pre><p>And there are sensible overrides for working directory and user when a container needs them:</p><pre><code>Run "npm run build" as the node user in the frontend container
</code></pre><h2>Reading logs</h2><p>When something breaks, the answer is almost always sitting in the logs, waiting to be read. Instead of bouncing over to another terminal and squinting at <code>docker logs</code>, just ask:</p><pre><code>Show me the last 50 lines of the app container logs
</code></pre><pre><code>What errors are in the nginx logs from the last 10 minutes?
</code></pre><pre><code>Check the database logs for slow queries
</code></pre><p>You get tail counts, time filters, and grep:</p><pre><code>Show me PHP fatal errors in the app logs from the last hour
</code></pre><p>The really nice part: the agent reads the logs, understands the error, opens the right file, fixes the bug, and verifies by checking the logs again. One loop, no context switching, no copy-paste shuffle.</p><h2>Compose operations</h2><p>The agent can drive your stack:</p><pre><code>Rebuild the app container
</code></pre><pre><code>Restart the database service
</code></pre><pre><code>Bring up the entire stack
</code></pre><pre><code>Stop all containers
</code></pre><p>This earns its keep after Dockerfile changes. Edit a Dockerfile or a config, and the agent can rebuild and restart without you ever leaving the conversation:</p><pre><code>Update the PHP Dockerfile to add the redis extension, then rebuild
</code></pre><p>The agent edits the Dockerfile, runs <code>docker compose build app</code>, and restarts the service. One prompt, three operations, done.</p><p>Only safe operations are allowed by default — <code>up</code>, <code>down</code>, <code>restart</code>, <code>build</code>, <code>pull</code>, <code>stop</code>, <code>start</code>, <code>ps</code>. No <code>rm</code>, no <code>--force-recreate</code> unless you pass it explicitly. Sharp edges stay sheathed.</p><h2>Environment sync check</h2><p>The classic Docker mystery: your <code>.env</code> says <code>DB_HOST=127.0.0.1</code>, but the container is happily talking to <code>DB_HOST=db</code>. Or you added a new variable to <code>.env</code> and forgot to rebuild, so the container is still running yesterday's reality.</p><pre><code>Check if my .env matches what the app container sees
</code></pre><p>The agent reads your host <code>.env</code>, runs <code>env</code> inside the container, and lines them up next to each other. You get three buckets:</p><p><strong>Missing in container</strong> — things in your <code>.env</code> the container doesn't have. Usually a rebuild is needed, or the variable isn't passed through in <code>docker-compose.yml</code>.</p><p><strong>Different values</strong> — same name, different value. The classic "works on my machine" generator.</p><p><strong>Only in container</strong> — variables the container has that aren't in your <code>.env</code>. System noise is filtered out; what's left is the app-level stuff that snuck in via a Dockerfile or compose file and never made it back into your documentation.</p><pre><code>&gt; Check if my .env matches what the app container sees

Missing in container (2):
- STRIPE_WEBHOOK_SECRET
- PUSHER_APP_KEY

Different values (1):
- DB_HOST: host="127.0.0.1" container="db"

Only in container (3):
- COMPOSER_ALLOW_SUPERUSER
- PHP_OPCACHE_VALIDATE_TIMESTAMPS
- PHP_MEMORY_LIMIT
</code></pre><p>Now you know exactly why Stripe webhooks aren't firing inside Docker, and why your host tests can't reach the database.</p><h2>The /docker command</h2><p>For a quick glance without involving the agent:</p><pre><code>/docker
</code></pre><p>Running containers, images, status, port mappings. Handy as a sanity check before you dive in, or right after a rebuild to confirm everything came back up the way it should.</p><h2>Where it really shines</h2><p><strong>Laravel Sail projects.</strong> Sail wraps everything in Docker, which is great until your agent starts trying to run <code>artisan</code> against host PHP that may or may not exist. With this extension, commands land where they should.</p><p><strong>Multi-service stacks.</strong> App, Node frontend, database, Redis, queue worker — the agent knows which container each command belongs in.</p><p><strong>Debugging "works on my machine" bugs.</strong> Host works, Docker doesn't? The env check finds the mismatch in seconds. The logs surface the real error. The agent can fix it without ever leaving the session.</p><p><strong>Onboarding.</strong> A new developer runs <code>docker compose up</code>, installs the extension, and the agent already understands the project's plumbing. No more "remember to run commands inside the container" notes pinned to the README.</p><h2>What it doesn't do</h2><p>It doesn't reach for remote Docker hosts, and it doesn't speak Kubernetes. This is firmly about your laptop — your <code>docker</code> CLI, your <code>docker-compose.yml</code>, your local containers.</p><p>It doesn't replace your Docker workflow, either. It just lets the agent join you inside it, so you can stop being the translator between what the agent wants to do and where it should actually run.</p>