forked from kd-11/rpcs3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.dockerrc
71 lines (63 loc) · 2.28 KB
/
.dockerrc
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# ~/.dockerrc
#
docker_rpcs3() {
INPUT_GID=$(getent group input | cut -d: -f3)
AUDIO_GID=$(getent group audio | cut -d: -f3)
ENTRYPOINT_ARGS=$@
DOCKER_RPCS3_SESSION="$PWD"
if true;
then
echo "Without OpenGL/Vulkan"
else
NVIDIA_ARGS="--runtime=nvidia \
-e DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-e XAUTHORITY \
-v $XAUTHORITY:$XAUTHORITY:ro \
--device /dev/nvidia-modeset \
-v /usr/share/vulkan/icd.d/nvidia_icd.json:/usr/share/vulkan/icd.d/nvidia_icd.json:ro \
-v /opt/vulkansdk:/opt/vulkansdk"
fi
if [ -z "INPUT_GID" ];
then
echo "Without Input (controller)"
else
INPUT="--device /dev/input \
--group-add "$INPUT_GID""
fi
if [ -z "AUDIO_GID" ];
then
echo "Without Audio"
else
AUDIO="--device /dev/snd \
--group-add "$AUDIO_GID""
fi
[ ! -d ~/.ccache ] && mkdir ~/.ccache
[ ! -d "$DOCKER_RPCS3_SESSION"/.developer ] && mkdir "$DOCKER_RPCS3_SESSION"/.developer
[ ! -d "$DOCKER_RPCS3_SESSION"/.developer/xdg ] && mkdir "$DOCKER_RPCS3_SESSION"/.developer/xdg
[ ! -d "$DOCKER_RPCS3_SESSION"/.developer/.cache ] && mkdir "$DOCKER_RPCS3_SESSION"/.developer/.cache
[ ! -d "$DOCKER_RPCS3_SESSION"/.developer/.config ] && mkdir "$DOCKER_RPCS3_SESSION"/.developer/.config
# Supposed to fix statx syscall for Qt but didnt worked... (seccomp=unconfined is less isolating)
# curl -O https://raw.githubusercontent.com/moby/moby/master/profiles/seccomp/default.json
# --security-opt="seccomp=default.json"
sudo docker run \
$NVIDIA_ARGS \
-ti \
--rm \
--cap-add=SYS_PTRACE \
--security-opt="seccomp=unconfined" \
$INPUT \
$AUDIO \
--group-add $(id -g) \
--user developer \
-v "$DOCKER_RPCS3_SESSION":/home/developer/rpcs3 \
-v "$DOCKER_RPCS3_SESSION"/.developer/xdg:/home/developer/xdg \
-v ~/.ccache:/home/developer/.ccache \
-v "$DOCKER_RPCS3_SESSION"/.developer/.cache:/home/developer/.cache/rpcs3 \
-v "$DOCKER_RPCS3_SESSION"/.developer/.config:/home/developer/.config/rpcs3 \
-e CC \
-e CXX \
-e BUILD_TYPE \
rpcs3 $ENTRYPOINT_ARGS
}