Quick tip: using curl to pipe into docker compose

JamesJames
1 min read

Ever needed to spin up a Docker Compose setup from a GitHub repo, but didn't want to clone the whole thing? I recently ran into this with Netflix Conductor. Instead of cloning or manually copying, try this:

Turns out we can use curl and pipe the contents into docker compose

curl https://raw.githubusercontent.com/Netflix/conductor/refs/heads/main/docker/docker-compose-postgres.yaml | docker compose -f - up -d

Just replace the URL with your desired docker-compose.yml location. Saves time and space!

The -f - flag tells Docker Compose to read the file from stdin*, so nothing ever hits disk.*

Only run this against YAML you trust; you’re effectively ‘curl-piping’ commands that can start arbitrary containers

0
Subscribe to my newsletter

Read articles from James directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

James
James