Merge pull request #180 from resin-io/fix-docker-root

Fix entry.sh when DOCKER_ROOT isn't set
This commit is contained in:
Page- 2016-06-23 12:46:39 -07:00 committed by GitHub
commit dc4f7a7583
3 changed files with 20 additions and 3 deletions

View File

@ -1,3 +1,5 @@
* Fix entry.sh when DOCKER_ROOT isn't set [Page]
# v1.11.4
* Cleanup docker images if delta failed [petrosagg]

View File

@ -23,6 +23,16 @@ fi
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
# If DOCKER_ROOT isn't set then default it
if [ -z "${DOCKER_ROOT}" ]; then
DOCKER_ROOT=/mnt/root/var/lib/rce
fi
# Mount the DOCKER_ROOT path equivalent in the container fs
DOCKER_LIB_PATH=${DOCKER_ROOT#/mnt/root}
if [ ! -d "${DOCKER_LIB_PATH}" ]; then
ln -s "${DOCKER_ROOT}" "${DOCKER_LIB_PATH}"
fi
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
supervisorctl -c /etc/supervisor/supervisord.conf start resin-supervisor

View File

@ -25,9 +25,14 @@ 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
# If DOCKER_ROOT isn't set then default it
if [ -z "${DOCKER_ROOT}" ]; then
DOCKER_ROOT=/mnt/root/var/lib/rce
fi
# Mount the DOCKER_ROOT path equivalent in the container fs
DOCKER_LIB_PATH=${DOCKER_ROOT#/mnt/root}
if [ ! -d "${DOCKER_LIB_PATH}" ]; then
ln -s "${DOCKER_ROOT}" "${DOCKER_LIB_PATH}"
fi
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf