Skip to content

Commit c2bf7a6

Browse files
committed
install: lxc docker prototype
1 parent bc631d6 commit c2bf7a6

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

install/docker/docker-compose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919

2020
services:
2121
scrypted:
22+
# LXC usage only
23+
# lxc privileged: true
24+
2225
environment:
2326
# Scrypted NVR Storage (Part 2 of 3)
2427

@@ -32,6 +35,9 @@ services:
3235
- SCRYPTED_WEBHOOK_UPDATE_AUTHORIZATION=Bearer SET_THIS_TO_SOME_RANDOM_TEXT
3336
- SCRYPTED_WEBHOOK_UPDATE=http://localhost:10444/v1/update
3437

38+
# LXC usage only
39+
# lxc - SCRYPTED_INSTALL_ENVIRONMENT=lxc-docker
40+
3541
# Avahi can be used for network discovery by passing in the host daemon
3642
# or running the daemon inside the container. Choose one or the other.
3743
# Uncomment next line to run avahi-daemon inside the container.
@@ -77,6 +83,11 @@ services:
7783

7884
# Default volume for the Scrypted database. Typically should not be changed.
7985
- ~/.scrypted/volume:/server/volume
86+
87+
# LXC usage only
88+
# lxc - /var/run/docker.sock:/var/run/docker.sock
89+
# lxc - ~/.scrypted/docker-compose.yml:/docker/docker-compose.yml
90+
8091
# Uncomment the following lines to use Avahi daemon from the host
8192
# Without this, AppArmor will block the container's attempt to talk to Avahi via dbus
8293
# security_opt:

install/docker/install-scrypted-docker-compose.sh

+14-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ then
77
fi
88

99
function readyn() {
10+
if [ "$SCRYPTED_NONINTERACTIVE" == "1" ]
11+
then
12+
yn="y"
13+
return
14+
fi
15+
1016
while true; do
1117
read -p "$1 (y/n) " yn
1218
case $yn in
@@ -50,9 +56,15 @@ WATCHTOWER_HTTP_API_TOKEN=$(echo $RANDOM | md5sum)
5056
DOCKER_COMPOSE_YML=$SCRYPTED_HOME/docker-compose.yml
5157
echo "Created $DOCKER_COMPOSE_YML"
5258
curl -s https://raw.githubusercontent.com/koush/scrypted/main/install/docker/docker-compose.yml | sed s/SET_THIS_TO_SOME_RANDOM_TEXT/"$(echo $RANDOM | md5sum | head -c 32)"/g > $DOCKER_COMPOSE_YML
53-
if [ -d /dev/dri ]
59+
60+
if [ -z "$SCRYPTED_LXC" ]
5461
then
55-
sed -i 's/'#' "\/dev\/dri/"\/dev\/dri/g' $DOCKER_COMPOSE_YML
62+
if [ -d /dev/dri ]
63+
then
64+
sed -i 's/'#' "\/dev\/dri/"\/dev\/dri/g' $DOCKER_COMPOSE_YML
65+
fi
66+
else
67+
sed -i 's/'#' lxc /g' $DOCKER_COMPOSE_YML
5668
fi
5769

5870
readyn "Install avahi-daemon? This is the recommended for reliable HomeKit discovery and pairing."

0 commit comments

Comments
 (0)