The development environment includes Git support and automatic SSH key forwarding, allowing you to use Git and authenticate with remote services from within containers.
Run Git commands from your project directory:
dev git status
dev git add .
dev git commit -m "message"
dev git pushThe dev git command:
- Runs Git inside the PHP container
- Uses your workspace directory as the working directory
- Forwards your SSH agent for authentication
- Preserves your user context
SSH keys are automatically forwarded from your host to the containers when available.
If the SSH_AUTH_SOCK environment variable is set on your host, the environment automatically:
- Detects your SSH agent
- Mounts the SSH auth socket into containers
- Sets up SSH agent forwarding
Start your SSH agent and add your key:
eval $(ssh-agent)
ssh-add ~/.ssh/id_rsaOr add to your shell profile (~/.bashrc or ~/.zshrc):
if [ -z "$SSH_AUTH_SOCK" ]; then
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
fiCheck if SSH agent is available in container:
dev console
echo $SSH_AUTH_SOCK
ssh-add -lYou should see your SSH keys listed.
Clone repositories:
dev console
cd /data/workspace/customer/project
git clone git@github.com:user/repo.gitAccess remote servers:
dev console
ssh user@remote-serverYour Git configuration from the host is not automatically available in containers. Set it up:
dev git config --global user.name "Your Name"
dev git config --global user.email "your@email.com"In your project:
cd workspace/customer/project
dev git config user.name "Your Name"
dev git config user.email "your@email.com"Create helpful aliases:
dev git config --global alias.co checkout
dev git config --global alias.br branch
dev git config --global alias.ci commit
dev git config --global alias.st statuscd workspace
dev git clone git@github.com:user/repo.git customer/projectcd workspace/customer/project
dev git pull
# make changes
dev git add .
dev git commit -m "Description of changes"
dev git pushdev git checkout -b feature-branch
dev git push -u origin feature-branch
dev git checkout main
dev git branch -d feature-branchWhen using Composer with private Git repositories, SSH forwarding allows authentication:
dev console
composer require organization/private-packageComposer will use your forwarded SSH keys to authenticate.
Alternatively, configure Composer with access tokens:
dev console
composer config --global github-oauth.github.com YOUR_TOKENTo use custom SSH configurations, mount your SSH config:
In docker-custom.yml:
version: '2'
services:
php:
volumes:
- ~/.ssh/config:/root/.ssh/config:roVerify SSH agent is running:
echo $SSH_AUTH_SOCK
ssh-add -lAdd your key if needed:
ssh-add ~/.ssh/id_rsaRestart containers:
dev restartEnsure you're using dev git, not just git:
dev git status # CorrectTest SSH connection:
dev console
ssh -T git@github.comVerify your key is in the agent:
dev console
ssh-add -lYou're using HTTPS instead of SSH. Clone with SSH:
# Not this:
dev git clone https://github.com/user/repo.git
# Use this:
dev git clone git@github.com:user/repo.gitOr convert existing repository:
dev git remote set-url origin git@github.com:user/repo.gitIf you use different SSH keys for different services:
Create ~/.ssh/config:
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_github
Host gitlab.com
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_rsa_gitlab
Add all keys to agent:
ssh-add ~/.ssh/id_rsa_github
ssh-add ~/.ssh/id_rsa_gitlab- advanced-docker-configuration.md - UID/GID and build arguments
- custom-compose-files.md - Mounting custom volumes