Menu

What I Learned Letting Users Paste docker-compose.yml Into a PaaS
πŸ“°

What I Learned Letting Users Paste docker-compose.yml Into a PaaS

DEV Community: dockerΒ·hoagminhΒ·about 1 hour ago
#NX4d8Ij7
#devtodocker#devto#dev#compose#application
Reading 0:00
15s threshold

Supporting custom Docker Compose looked simple when I first thought about it:

let the user paste a docker-compose.yml ;

save it on the VPS;

run docker compose up -d ;

celebrate. πŸŽ‰

The problem is that a Compose file is not just a list of containers.

It can mount the host filesystem, join the host network, access devices, add Linux capabilities, reuse another application's network, publish arbitrary ports, or mount the Docker socketβ€”which is effectively control over the Docker host.

So the real workflow cannot be this:

Compose file ──────────────────────────► Docker daemon

Enter fullscreen mode

Exit fullscreen mode

It needs a boundary in the middle:

Compose file β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Parse β†’ Normalize β†’ Inspect β”‚ β”‚ Transform β†’ Resolve β†’ Check β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ accepted └────► refused with a reason β–Ό Docker daemon

Enter fullscreen mode

Exit fullscreen mode

This is the problem behind the Compose safety policy in Nitrobase.

Nitrobase has only recently…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.