2014-04-27 21:46:59 +00:00
|
|
|
#!/bin/sh
|
2014-06-10 00:05:16 +00:00
|
|
|
|
2016-07-06 08:45:32 +00:00
|
|
|
set -o errexit
|
2014-04-27 21:46:59 +00:00
|
|
|
|
2017-03-07 16:09:06 +00:00
|
|
|
[ -d /mnt/root/tmp/resin-supervisor ] ||
|
|
|
|
mkdir -p /mnt/root/tmp/resin-supervisor
|
2014-04-27 21:46:59 +00:00
|
|
|
|
2016-06-23 18:07:18 +00:00
|
|
|
# If DOCKER_ROOT isn't set then default it
|
|
|
|
if [ -z "${DOCKER_ROOT}" ]; then
|
|
|
|
DOCKER_ROOT=/mnt/root/var/lib/rce
|
|
|
|
fi
|
2016-07-06 08:45:32 +00:00
|
|
|
|
2016-06-23 18:07:18 +00:00
|
|
|
# Mount the DOCKER_ROOT path equivalent in the container fs
|
|
|
|
DOCKER_LIB_PATH=${DOCKER_ROOT#/mnt/root}
|
2016-07-06 08:45:32 +00:00
|
|
|
|
2016-06-23 18:07:18 +00:00
|
|
|
if [ ! -d "${DOCKER_LIB_PATH}" ]; then
|
|
|
|
ln -s "${DOCKER_ROOT}" "${DOCKER_LIB_PATH}"
|
2016-06-09 05:15:24 +00:00
|
|
|
fi
|
2018-03-16 14:01:50 +00:00
|
|
|
|
|
|
|
if [ -z "$DOCKER_SOCKET" ]; then
|
|
|
|
export DOCKER_SOCKET=/run/docker.sock
|
|
|
|
fi
|
|
|
|
|
|
|
|
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
|
|
|
|
|
|
|
|
exec node /usr/src/app/dist/app.js
|