2022-09-09 11:37:37 +02:00
# Jumpbox Docker container
* Debian slim based image
* OpenSSH server
2022-09-15 14:31:45 +02:00
* User/group creation on startup
2022-09-09 11:37:37 +02:00
# Supported tags and respective `Dockerfile` links
- [`latest` ](https://git.nethuis.nl/pommi/docker-jumpbox/Dockerfile )
# Usage
2022-09-15 14:30:12 +02:00
## Environment variables
| Key | Format | Description |
| --- | --- | --- |
| `ROOT_AUTHORIZED_KEYS` | `/path/to/file` | Path to file that contains the public SSH keys that can be used for root user authentication. This file will be copied to `/root/.ssh/authorized_keys` |
2022-09-17 14:21:53 +02:00
| `HOSTKEYS` | `/path/to/hostkey;...` | Specifies a (semi-colon separated list of) file(s) containing a private host key used by SSH. |
2022-09-15 14:31:45 +02:00
| `USERADD` | `{username}:{uid}:{gid};...` | Create user account(s) on startup |
| `GROUPADD` | `{groupname}:{gid};...` | Create group account(s) on startup |
| `BASE_DIR` | `/home` | Basedir used for user account creation (Default: `/home` ) |
2022-09-15 14:30:12 +02:00
## docker run
2022-09-09 11:37:37 +02:00
```
$ docker run -it \
--name jumpbox \
2022-09-15 14:30:12 +02:00
-v $(pwd)/jumpbox:/var/lib/jumpbox \
-e "ROOT_AUTHORIZED_KEYS=/var/lib/jumpbox/authorized_keys"
2022-09-17 14:21:53 +02:00
-e "HOSTKEYS=/var/lib/jumpbox/ssh_host_ed25519_key;/var/lib/jumpbox/ssh_host_rsa_key"
2022-09-15 14:31:45 +02:00
-e "USERADD=jumpbox:1000:1000"
-e "GROUPADD=jumpbox:1000"
2022-09-09 11:37:37 +02:00
-p 1022:22 \
pommib/jumpbox:latest
```
2022-09-15 14:30:12 +02:00
## docker-compose
2022-09-09 11:37:37 +02:00
```
version: "3"
services:
jumpbox:
container_name: jumpbox
image: pommib/jumpbox:latest
ports:
- "1022:22/tcp"
volumes:
2022-09-15 14:30:12 +02:00
- '${PWD}/jumpbox:/var/lib/jumpbox'
environment:
ROOT_AUTHORIZED_KEYS: /var/lib/jumpbox/authorized_keys
2022-09-17 14:21:53 +02:00
HOSTKEYS: /var/lib/jumpbox/ssh_host_ed25519_key;/var/lib/jumpbox/ssh_host_rsa_key
2022-09-15 14:31:45 +02:00
USERADD: jumpbox:1000:1000
GROUPADD: jumpbox:1000
2022-09-09 11:37:37 +02:00
```