services: composer: environment: SSH_AUTH_SOCK: /run/host-services/ssh-auth.sock volumes: - .:/code # Share the ssh-agent's socket to be able to install dependencies from private repositories via Composer. # We are not actually pointing at the socket on a host system, we are pointing at some other special machinery # in Docker Desktop for macOS that enables specifically the SSH agent forwarding. # Requires Docker Desktop 2.2+ in case of macOS. Related issue: https://github.com/docker/for-mac/issues/410 # The appropriate SSH key must be added to the SSH agent on the host before running composer install. - /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock