Updates
This commit is contained in:
8
devc.sh
8
devc.sh
@@ -60,6 +60,9 @@ param_args() {
|
||||
arg "-v /run/user/$UID/bus:/tmp/bus"
|
||||
arg "-e HOST_HOME=$HOME" # Used to translate paths.
|
||||
;;
|
||||
-net) # Enable network dev-<container name>
|
||||
arg "--network dev-$name"
|
||||
;;
|
||||
-x11) # Enable X11 support.
|
||||
arg "-v /tmp/.X11-unix:/tmp/.X11-unix"
|
||||
arg "-v $XAUTHORITY:/run/user/1000/.Xauthority:ro"
|
||||
@@ -89,10 +92,6 @@ 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
|
||||
@@ -112,6 +111,7 @@ fi
|
||||
# recreate it.
|
||||
if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ] || [[ $# -gt 0 ]]; then
|
||||
log "starting devcontainer..."
|
||||
podman network create --ignore "dev-$name"
|
||||
podman container rm -f -t 0 "$name" 1>/dev/null
|
||||
podman run -td $(default_args) $(param_args $@) "$registry/$image"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user