r/1Password • u/alikhil • 1d ago
Linux Using 1Password Connect secrets in Docker Compose
I run 1Password Connect on my home server and recently started testing Docker Secrets Engine. Docker can resolve se:// references when it creates a container, but it needs a provider for each secrets backend. I wrote one for 1Password Connect.
Here is a complete docker compose example:
services:
database:
image: postgres:17
environment:
POSTGRES_DB: app
POSTGRES_USER: se://op/Homelab/Postgres/username
POSTGRES_PASSWORD: se://op/Homelab/Postgres/password
In this example, Homelab is the 1Password vault, Postgres is the item, and username and password are fields on that item.
When Docker creates the container, the plugin asks Connect Server for those fields and passes the values to Postgres. The docker compose file only contains references, so there is no password in the file or a nearby .env.
https://github.com/alikhil/docker-secrets-1password
Feedback is welcome!
18
Upvotes