aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2026-07-01 22:35:54 +0200
committerNicholas Rodrigues Lordello <[email protected]>2026-07-01 22:55:29 +0200
commitd07d395b09ec1a87677712e7b50ac520495ed573 (patch)
treeafe49d6d9f006deb54608f1a30fdff3348767f30 /Makefile
parent224bbea0cd08efd3d85623c8a60883306cc4d008 (diff)
Port `dbx` To Use `container machine`
With `container` v1, a new `machine` subcommand was introduced in order to support long-lived machines. Port the `dbx` utility to use `container machine` instead of using regular containers. The main motivation for this is: - `container machine`s are more elastic; when they are stopped their containers are removed entirely (which is different to a container that is stopped, but not removed) - `container machine`s can modify settings (such as CPU and memory limits) after creation, allowing for the machine to change over time as needed Overall, the structure stays largely the same as before; the main difference being how initialization is done (since `container machine` has built-in support for initializing a user with passwordless `sudo`). Note we explicitly set `--home-mount=none` in order to keep the same filesystem isolation guarantees that existed before (files can be copied with `scp`; there is no `container cp` analogy for machines). One notable difference is network management. `container machine`s are assigned their own virtual network device and get a completely separate IP to the host (which is different than before where container ports were being published to the host). I do not know which one is more secure...
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 4 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index c1da571..7377817 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
+DBX_IMAGE ?= dbx
+
.PHONY: all
-all: .container ssh/config ;
+all: .container ssh/id_ed25519 ;
.PHONY: install
install: all
@@ -7,13 +9,8 @@ install: all
ln -s $(PWD)/dbx $(HOME)/.local/bin/dbx
.container: Containerfile dbx-init ssh/id_ed25519.pub
- container build --build-arg USER=$(USER) --pull --tag dbx .
+ container build --pull --tag $(DBX_IMAGE) .
touch $@
-ssh/config: ssh/config.in ssh/id_ed25519.pub
- cat $< \
- | sed -e 's|$$PWD|$(PWD)|' \
- > $@
-
ssh/id_% ssh/id_%.pub:
ssh-keygen -C "$$(id -un)@$$(hostname)" -f ssh/id_$* -N "" -t $*