1
0

add support for creation of user/groups

This commit is contained in:
2022-09-15 14:31:45 +02:00
parent 289592cbf6
commit 379876f4f6
2 changed files with 43 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
* Debian slim based image
* OpenSSH server
* User/group creation on startup
# Supported tags and respective `Dockerfile` links
@@ -14,6 +15,9 @@
| 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` |
| `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`) |
## docker run
@@ -22,6 +26,8 @@ $ docker run -it \
--name jumpbox \
-v $(pwd)/jumpbox:/var/lib/jumpbox \
-e "ROOT_AUTHORIZED_KEYS=/var/lib/jumpbox/authorized_keys"
-e "USERADD=jumpbox:1000:1000"
-e "GROUPADD=jumpbox:1000"
-p 1022:22 \
pommib/jumpbox:latest
```
@@ -41,4 +47,6 @@ services:
- '${PWD}/jumpbox:/var/lib/jumpbox'
environment:
ROOT_AUTHORIZED_KEYS: /var/lib/jumpbox/authorized_keys
USERADD: jumpbox:1000:1000
GROUPADD: jumpbox:1000
```