forked from Job79/devcontainer
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
DEVC_COMMAND=/home/user/AndroidStudio/bin/studio
|
|
||||||
2
containers/fedora/config.sh
Normal file
2
containers/fedora/config.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
arg "-p 8080:8080"
|
||||||
3
containers/rider/config.sh
Normal file
3
containers/rider/config.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
arg "-p 8080:8080"
|
||||||
|
arg "-p 8081:8081"
|
||||||
@@ -1 +0,0 @@
|
|||||||
DEVC_COMMAND=/home/user/Rider/bin/rider
|
|
||||||
8
devc.sh
8
devc.sh
@@ -60,6 +60,9 @@ param_args() {
|
|||||||
arg "-v /run/user/$UID/bus:/tmp/bus"
|
arg "-v /run/user/$UID/bus:/tmp/bus"
|
||||||
arg "-e HOST_HOME=$HOME" # Used to translate paths.
|
arg "-e HOST_HOME=$HOME" # Used to translate paths.
|
||||||
;;
|
;;
|
||||||
|
-net) # Enable network dev-<container name>
|
||||||
|
arg "--network dev-$name"
|
||||||
|
;;
|
||||||
-x11) # Enable X11 support.
|
-x11) # Enable X11 support.
|
||||||
arg "-v /tmp/.X11-unix:/tmp/.X11-unix"
|
arg "-v /tmp/.X11-unix:/tmp/.X11-unix"
|
||||||
arg "-v $XAUTHORITY:/run/user/1000/.Xauthority:ro"
|
arg "-v $XAUTHORITY:/run/user/1000/.Xauthority:ro"
|
||||||
@@ -89,10 +92,6 @@ else
|
|||||||
fi
|
fi
|
||||||
name="${image%:*}"
|
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
|
# Get container registry from the DEVC_REGISTRY env
|
||||||
# variable.
|
# variable.
|
||||||
if [ -n "${DEVC_REGISTRY:-}" ]; then
|
if [ -n "${DEVC_REGISTRY:-}" ]; then
|
||||||
@@ -112,6 +111,7 @@ fi
|
|||||||
# recreate it.
|
# recreate it.
|
||||||
if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ] || [[ $# -gt 0 ]]; then
|
if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ] || [[ $# -gt 0 ]]; then
|
||||||
log "starting devcontainer..."
|
log "starting devcontainer..."
|
||||||
|
podman network create --ignore "dev-$name"
|
||||||
podman container rm -f -t 0 "$name" 1>/dev/null
|
podman container rm -f -t 0 "$name" 1>/dev/null
|
||||||
podman run -td $(default_args) $(param_args $@) "$registry/$image"
|
podman run -td $(default_args) $(param_args $@) "$registry/$image"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user