refactor: restrict container host access
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
for dir in "Code" "Documents" "Downloads" ".config/devcontainer"; do
|
||||
for dir in "Code" "Downloads" ".config/devcontainer"; do
|
||||
arg "-v $HOME/$dir:/home/user/$dir"
|
||||
done
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
for dir in "Code" "Documents" "Downloads" ".config/devcontainer"; do
|
||||
for dir in "Code" "Downloads" ".config/devcontainer"; do
|
||||
arg "-v $HOME/$dir:/home/user/$dir"
|
||||
done
|
||||
|
||||
3
enter.sh
3
enter.sh
@@ -23,6 +23,7 @@ run_args() {
|
||||
# container.
|
||||
[ -e "/run/user/$UID/bus" ] && arg "-v /run/user/$UID/bus:/tmp/bus" # Use host dbus.
|
||||
arg "-e HOST_HOME=$HOME" # Used to translate container path to host.
|
||||
arg "-e CONTAINER_NAME=$name"
|
||||
|
||||
# Use host networking.
|
||||
arg "--net=host"
|
||||
@@ -82,4 +83,4 @@ if [ "$pull" = true ] || [ "$(podman container inspect "$name" -f {{.State.Runni
|
||||
fi
|
||||
|
||||
podman start "$name" 1>/dev/null
|
||||
podman exec -e CONTAINER_NAME="$name" -e ENTER_DIR="${PWD/#$HOME/\~}" --detach-keys "ctrl-@" -it "$name" bash -l
|
||||
podman exec -e ENTER_DIR="${PWD/#$HOME/\~}" --detach-keys "ctrl-@" -it "$name" bash -l
|
||||
|
||||
Reference in New Issue
Block a user