diff --git a/CHANGELOG.md b/CHANGELOG.md index 12157b69..5b274282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Fix entry.sh when DOCKER_ROOT isn't set [Page] + # v1.11.4 * Cleanup docker images if delta failed [petrosagg] diff --git a/entry.alpine.sh b/entry.alpine.sh index 421dd863..0c55997f 100755 --- a/entry.alpine.sh +++ b/entry.alpine.sh @@ -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 diff --git a/entry.sh b/entry.sh index c80f8e4e..41186c75 100755 --- a/entry.sh +++ b/entry.sh @@ -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