Skip to content

Docker Compose recipe for running pgAdmin 4 with the host machine SSH keys

Notifications You must be signed in to change notification settings

chris-kobrzak/pgadmin4-ssh-tunnel-dockerfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

pgadmin4-ssh-tunnel-dockerfile

Docker Compose recipe for running pgAdmin 4 as a Docker container with SSH keys shared by the host machine.

Based on this StackOverflow question.

Use case

As of late 2021 pgAdmin 4 macOS application is not compatible with Mac computers with the Apple M1 chip. But it is still possible to run pgAdmin 4 in Docker on these machines.

But if you need to connect to remote Postgres servers that use SSH key authentication, the container needs to hold a valid SSH key. It is quite practical to share the host machine's SSH keys instead of generating keys for each of the containers and this Docker Compose recipe mounts the host's ~/.ssh directory to achieve this.

However, since the oficial Docker image for the ARM architecture uses a non-privileged user, the recipe elevates the container role to root to be able to access the mounted host's SSH keys in pgAdmin (connection preferences dialog / SSH Tunnel tab).

About

Docker Compose recipe for running pgAdmin 4 with the host machine SSH keys

Topics

Resources

Stars

Watchers

Forks