mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 14:13:08 +00:00
af32a48db4
docker-delta uses the docker API to query the docker root location. However, docker returns the path in the host, not the path that it happens to be bind mounted in the supervisor container. So in order for the deltas to work properly, these paths must be the same. Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
41 lines
947 B
Bash
Executable File
41 lines
947 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
[ -d /dev/net ] ||
|
|
mkdir -p /dev/net
|
|
[ -c /dev/net/tun ] ||
|
|
mknod /dev/net/tun c 10 200
|
|
|
|
cd /app
|
|
|
|
mkdir -p /var/log/supervisor && touch /var/log/supervisor/supervisord.log
|
|
mkdir -p /var/run/resin
|
|
mount -t tmpfs -o size=1m tmpfs /var/run/resin
|
|
|
|
if [ -z "$GOSUPER_SOCKET" ]; then
|
|
export GOSUPER_SOCKET=/var/run/resin/gosuper.sock
|
|
fi
|
|
if [ -z "$DOCKER_SOCKET" ]; then
|
|
export DOCKER_SOCKET=/run/docker.sock
|
|
fi
|
|
if [ -z "$HOST_PROC" ]; then
|
|
export HOST_PROC=/mnt/root/proc
|
|
fi
|
|
|
|
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
|
|
|
|
# If docker data directory isn't mounted in the default path, symlink it
|
|
if [ ! -d /var/lib/docker ]; then
|
|
ln -s "$DOCKER_ROOT" /var/lib/docker
|
|
fi
|
|
|
|
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
|
|
|
supervisorctl start resin-supervisor
|
|
supervisorctl start go-supervisor
|
|
|
|
tail -F \
|
|
/var/log/supervisor/supervisord.log \
|
|
/var/log/resin_supervisor_stdout.log
|