-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
35 lines (27 loc) · 907 Bytes
/
run.sh
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
#!/usr/bin/env bash
#set -euo pipefail
source variables.sh
container="senorsmile-anki"
mkdir -p "${HOME}/anki-docker/"
opts=(
-d
-v "${HOME}/Downloads:/root/Downloads"
-v "${HOME}/Documents:/root/Documents"
# do NOT share with a host installed folder... create a new custom path
-v "${HOME}/anki2-docker-${anki_version}:/root/.local/share/Anki2"
-v /etc/localtime:/etc/localtime:ro
-v /tmp/.X11-unix:/tmp/.X11-unix # mount the X11 socket
#-e DISPLAY=unix$DISPLAY # pass the display
-e "DISPLAY=${DISPLAY}" # better way to pass display?
--device /dev/snd # sound
--device /dev/dri # necessary?
--name anki
--restart always
"${container}:${anki_version}-${build_num}"
)
# https://unix.stackexchange.com/questions/209746/how-to-resolve-no-protocol-specified-for-su-user
#xauth + local:
xhost + local:
docker stop anki || echo
docker rm anki || echo
docker run ${opts[@]}