forked from Job79/devcontainer
This commit is contained in:
8
devc.sh
8
devc.sh
@@ -52,6 +52,10 @@ param_args() {
|
||||
case "$1" in
|
||||
-gpu) # Enable gpu acceleration.
|
||||
arg "--device /dev/dri" ;;
|
||||
-kvm) # Enable KVM
|
||||
arg "--device /dev/kvm" ;;
|
||||
-usb) # Enable USB access
|
||||
arg "--device /dev/bus/usb" ;;
|
||||
-host-spawn) # Enable spawning host commands from inside the container using host-spawn.
|
||||
arg "-v /run/user/$UID/bus:/tmp/bus"
|
||||
arg "-e HOST_HOME=$HOME" # Used to translate paths.
|
||||
@@ -85,6 +89,10 @@ else
|
||||
fi
|
||||
name="${image%:*}"
|
||||
|
||||
# check if ENV file is present, if so, source it
|
||||
env_file="$(dirname "$(realpath "$0")")/containers/$name/env"
|
||||
[ -f "$env_file" ] && source "${env_file}"
|
||||
|
||||
# Get container registry from the DEVC_REGISTRY env
|
||||
# variable.
|
||||
if [ -n "${DEVC_REGISTRY:-}" ]; then
|
||||
|
||||
Reference in New Issue
Block a user