Last active
August 6, 2026 06:59
-
-
Save ajeetraina/478e94f3b7531b7efca24276e3aa28aa to your computer and use it in GitHub Desktop.
Setting up Docker Sandbox with DHI MCP and AI Governance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Setup Docker Sandbox | |
| $ brew install docker/tap/sbx | |
| $ export SBX_MCP_URL=https://gateway.docker.com | |
| $ sbx daemon stop && sbx daemon start -d | |
| $ sbx mcp --help | |
| $ sbx mcp ls | |
| ## Setup MCP Access Policy: | |
| ``` | |
| permit ( | |
| principal, | |
| action == MCP::Action::"register", | |
| resource | |
| ); | |
| permit ( | |
| principal, | |
| action == MCP::Action::"invokeTool", | |
| resource | |
| ); | |
| permit ( | |
| principal, | |
| action == MCP::Action::"invokePrimordial", | |
| resource | |
| ); | |
| ``` | |
| ## Add DHI MCP via Docker MCP Gateway | |
| $ sbx mcp add remotedhi --url https://dhi.io/mcp | |
| $ sbx mcp inspect remotedhi | |
| Name: remotedhi | |
| Type: remote | |
| URL: https://dhi.io/mcp | |
| Transport: streamable-http | |
| ## Accessing DHI MCP Tools | |
| $ cd ~/workdemo | |
| $ sbx run codex --static-mcp remotedhi | |
| Type /mcp | |
| ๐ MCP Tools | |
| โข mcp-gateway | |
| โข Auth: Unsupported | |
| โข Tools: code-mode, mcp-config-set, mcp-exec, remotedhi__dhi_create_mirror, | |
| remotedhi__dhi_get_image_attestations, remotedhi__dhi_get_image_cves, remotedhi__dhi_get_image_details, | |
| remotedhi__dhi_get_image_packages, remotedhi__dhi_get_repository, remotedhi__dhi_get_tag_definition, | |
| remotedhi__dhi_list_mirrors, remotedhi__dhi_list_repositories, remotedhi__dhi_remove_mirror | |
| Two things to flag about this policy as written: | |
| 1. It's allow-everything. permit(principal, action == โฆ, resource) with no when/resource scoping permits every principal against every resource for all three actions. That unblocks your lab, but it's the anti-pattern a governance course exists to warn against โ it's "governance turned off." Fine as a temporary unblock; don't ship it as the lab's exemplar. | |
| 2. Your lab doc is out of date on the action name. 06-mcp-hands-on.md uses MCP::Action::"invoke" (line ~332, 372,ย 394). The real schema here is invokeTool (+ invokePrimordial, + register). If learners copy the doc's invoke, it won't match โ the lab needs updating to the actual action names. | |
| For the DHI story you're building, the far better teaching artifact is a scoped version of this โ permit register and the read-only dhi_get_*/dhi_list_* tools, but not dhi_create_mirror/dhi_remove_mirror, and not invokePrimordial wide-open. Something like: | |
| // Anyone in the org may register servers | |
| permit (principal, action == MCP::Action::"register", resource); | |
| // Read-only DHI tools are invocable; mirror-mutation + primordials are not | |
| permit ( | |
| principal, | |
| action == MCP::Action::"invokeTool", | |
| resource | |
| ) when { | |
| resource.server == "remotedhi" && | |
| ["dhi_get_image_cves","dhi_get_image_details","dhi_get_image_packages", | |
| "dhi_get_image_attestations","dhi_get_tag_definition","dhi_get_repository", | |
| "dhi_list_repositories","dhi_list_mirrors"].contains(resource.tool) | |
| }; | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โจโUpdate available! 0.146.0 -> 0.146.1 โ
โ Run npm install -g @openai/codex to update. โ
โ โ
โ See full release notes: โ
โ https://github.com/openai/codex/releases/latest โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ >_ OpenAI Codex (v0.146.0) โ
โ โ
โ model: gpt-5.6-sol /model to change โ
โ directory: /Users/โฆ/work/labspace-docker-ai-governance โ
โ permissions: YOLO mode โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Tip: Our most capable model yet. GPT-5.6 Sol can tackle complex code changes, dig into research, produce polished documents, and take on your most ambitious
work. Sol is highly capable at lower reasoning effortsโtry starting lower, then turn it up for harder jobs.
/mcp
๐ MCP Tools
โข mcp-gateway
โข Auth: Unsupported
โข Tools: code-mode, dhi_create_mirror, dhi_get_image_attestations, dhi_get_image_cves, dhi_get_image_details, dhi_get_image_packages, dhi_get_repository,
dhi_get_tag_definition, dhi_list_mirrors, dhi_list_repositories, dhi_remove_mirror, mcp-exec
โบ Find NodeJS DHI images available in our catalog
โ Falling back from WebSockets to HTTPS transport. stream disconnected before completion: Attack attempt detected
โข Iโll check the connected catalog sources for Node.js Docker Hardened Images and return the available entries.
โบ List the DHI variants (dev vs runtime) for the nginx repository.
โข Iโll inspect the live dhi/nginx repository metadata and group its supported tags into development and runtime variants.
โข Called mcp-gateway.dhi_get_repository({"repoName":"nginx","includeUnsupportedTagDefinitions":false})
โ {"type": "IMAGE", "namespace": "dhi", "name": "nginx", "displayName": "Nginx", "shortDescription": "nginx ("engine x") is an HTTP web server, reverse proxy,
content cache, load balancer, TCP/UDP proxy server, and mail proxy server.", "featured": true, "fipsCompliant": true, "stigCertified": true, "homeUrl":
"https://nginx.org/", "categories": [{"id": "web-servers", "name": "Web servers"}], "alternatives": ["nginx:stable", "nginx:mainline"], "overview": "##
About Nginx\n\nNginx (pronounced "engine-x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as\nwell as a load
balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on\nhigh concurrency, high performance and low
memory usage. It...
โข Called mcp-gateway.dhi_get_repository({"repoName":"nginx","includeUnsupportedTagDefinitions":false})
โ {"type": "IMAGE", "namespace": "dhi", "name": "nginx", "displayName": "Nginx", "shortDescription": "nginx ("engine x") is an HTTP web server, reverse proxy,
content cache, load balancer, TCP/UDP proxy server, and mail proxy server.", "featured": true, "fipsCompliant": true, "stigCertified": true, "homeUrl":
"https://nginx.org/", "categories": [{"id": "web-servers", "name": "Web servers"}], "alternatives": ["nginx:stable", "nginx:mainline"], "overview": "##
About Nginx\n\nNginx (pronounced "engine-x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as\nwell as a load
balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on\nhigh concurrency, high performance and low
memory usage. It...
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โข The dhi/nginx repository has these supported variants:
Variant Stable Mainline
โโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Runtime Standard, FIPS Standard, FIPS, Debian compat
โโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Dev Standard, FIPS Standard, FIPS
Available bases: Alpine 3.23, Alpine 3.24, and Debian 13.
Tag suffixes identify the variant:
Runtime images are minimal and non-root. Dev images run as root and include a shell, package manager, envsubst entrypoint support, and nginx-debug.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ