initial commit

This commit is contained in:
maurice
2025-10-25 14:30:39 +02:00
commit e99337652d
13 changed files with 205 additions and 0 deletions

30
enter.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
# Check if a name argument was provided
if [ -z "$1" ]; then
echo "Usage: $0 <name>"
exit 1
fi
name="devc-$1"
command="/bin/bash"
# When container is not running or arguments are provided,
# recreate it.
if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ]; then
echo "starting devcontainer..."
podman container rm -f -t 0 "$name" 1>/dev/null
podman run \
--security-opt label=disable \
--userns=keep-id \
--name $name \
-e HOST_HOME=$HOME \
-e SSH_AUTH_SOCK='/tmp/ssh.sock' \
-v /run/user/$UID/bus:/tmp/dbus.sock \
-v /run/user/$UID/keyring/ssh:/tmp/ssh.sock \
-v $HOME/Dev:/home/user/dev \
-v v-$name:/home/user:copy \
--rm -td $name
fi
podman exec --detach-keys "ctrl-@" -it "$name" ${command:-}