aboutsummaryrefslogtreecommitdiff
path: root/dbx-create
blob: 48b263398b5a5ed20d45f4b1c04a53df9f5aae37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-only

set -euo pipefail

R="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
C="dbx"

echo "TODO:"
echo "- create temporary SSH key"
echo "- generate SSH configuration for host and guest"
echo "- create base container image"
echo "  - initialize user"
echo "  - add authorized keys for SSH login"
echo "  - install required packages (sshd and tini)"
echo "  - install nice to have packages (see toolbox image)"
echo "  - setup socket cleanup with sshd_config"
echo "- magic encantation to create container"

#if ! id $DBX_USER &>/dev/null; then
#	useradd \
#		--comment "$DBX_USER_COMMENT" \
#		--create-home \
#		--groups sudo \
#		--shell /usr/bin/bash \
#		--uid 1000 \
#		--user-group \
#		$DBX_USER
#fi
# if container list --all | grep $C >/dev/null; then
# 	echo "already created"
# 	exit
# fi
# podman create \
# 	--hostname dbx \
# 	--label manager=dbx \
# 	--name "$c" \
# 	--user root:root \
# 	--userns keep-id \
# 	--volume "$d:$d:z" \
# 	--volume "$r/dbx-init:/usr/local/bin/dbx-init:ro,z" \
# 	registry.fedoraproject.org/fedora-toolbox:43 \
# 	dbx-init "$(id -u)" "$(id -g)"
# podman start "$c" >/dev/null