Is there a way to use 1Password in combination with DDEV and colima?

111 Views Asked by At

I'd like to use the SSH agent feature of 1Password in combination with my DDEV projects that run with colima as its docker provider. That means that the DDEV web container is able to use the SSH keys stored inside 1Password.

1

There are 1 best solutions below

2
On

This is possible by the following steps:

  1. Setup SSH_AUTH_SOCK like described here: https://developer.1password.com/docs/ssh/agent/compatibility/#ssh-auth-sock (currently running 1password cli v2.23.0)
  2. Start colima with colima start --ssh-agent (currently running colima v0.6.6) This has to be done only once. It sets forwardAgent: true in the colima configuration. After that you can simply use colima start like before.
  3. Create a custom docker-compose file in your ddev project's .ddev directory with the following content
services:
 web:
   volumes:
     - type: bind
       source: /run/host-services/ssh-auth.sock
       target: /run/host-services/ssh-auth.sock
   environment:
     - SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
  1. Start the ddev project and enjoy 1password ssh key handling within the ddev web container