-
Notifications
You must be signed in to change notification settings - Fork 0
/
spacen
executable file
·40 lines (37 loc) · 1.01 KB
/
spacen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
. ~/.bashrc
if [ -z $SPACE ]
then
echo '$SPACE is undefined: space location'
exit
fi
if [ -z $1 ]
then
echo '$1 is undefined: container image'
exit
fi
podman kill space
podman rm space
podman run -it \
-p 2222:2222 \
--name space \
--network bridge \
--mac-address $(printf '%02X:%02X:%02X:%02X:%02X:%02X' $[RANDOM%256] $[RANDOM%256] $[RANDOM%256] $[RANDOM%256] $[RANDOM%256] $[RANDOM%256]) \
--hostname fedora \
--security-opt label=disable \
--mount type=tmpfs,tmpfs-size=1G,destination=/run \
--mount type=tmpfs,tmpfs-size=8G,destination=/tmp \
--mount type=tmpfs,tmpfs-size=8G,destination=/dev/shm \
-v /opt:/host/opt \
-v /usr:/host/usr \
-v /dev/bus:/dev/bus \
-v /dev/dri:/dev/dri \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $SPACE/bashrc:/etc/bashrc \
-v $SPACE/environment:/etc/environment \
-v $SPACE/opt:/opt \
-v $SPACE/home:/home \
-v $SPACE/etc:/host/etc \
-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
-v $XDG_RUNTIME_DIR/pipewire-0:/tmp/pipewire-0 \
$1 /opt/spacerc