Browse Source

docker-compose: mount user config including authorized_keys

Fabian Peter Hammerle 3 years ago
parent
commit
86dbe52ebe
2 changed files with 5 additions and 1 deletions
  1. 1 1
      README.md
  2. 4 0
      docker-compose.yml

+ 1 - 1
README.md

@@ -30,5 +30,5 @@ $ ssh -J bob@bastion:2022 -p 20221 localhost
 ### Docker Compose 🐙
 
 1. `git clone https://github.com/fphammerle/docker-ssh-bastion`
-2. Adapt `$USERS` and paths in [docker-compose.yml](docker-compose.yml)
+2. Adapt `$USERS` and volumes in [docker-compose.yml](docker-compose.yml)
 3. `docker-compose up`

+ 4 - 0
docker-compose.yml

@@ -2,6 +2,8 @@ version: '2'
 
 volumes:
   host_keys:
+  config_alice:
+  config_bob:
 
 services:
   ssh_bastion:
@@ -11,6 +13,8 @@ services:
       USERS: alice,bob
     volumes:
     - host_keys:/etc/ssh/host_keys:rw
+    - config_alice:/home/alice/.ssh:ro
+    - config_bob:/home/bob/.ssh:ro
     ports:
     - '0.0.0.0:2222:22'
     restart: unless-stopped