Remove DOCKER_ROOT assignments from entry.sh

These variables are not used anywhere and they don't seem to serve any
purpose. Cleaning these assingments as dead code
This commit is contained in:
Felipe Lalanne 2022-11-03 10:17:03 -03:00
parent 0bb3f0ad1f
commit 460c3ba0aa

View File

@ -6,38 +6,22 @@ set -o errexit
# already be using to take an update lock, so we symlink it to the new # already be using to take an update lock, so we symlink it to the new
# location so that the supervisor can see it # location so that the supervisor can see it
[ -d /mnt/root/tmp/resin-supervisor ] && [ -d /mnt/root/tmp/resin-supervisor ] &&
( [ -d /mnt/root/tmp/balena-supervisor ] || ln -s ./resin-supervisor /mnt/root/tmp/balena-supervisor ) ([ -d /mnt/root/tmp/balena-supervisor ] || ln -s ./resin-supervisor /mnt/root/tmp/balena-supervisor)
# Otherwise, if the lockfiles directory doesn't exist # Otherwise, if the lockfiles directory doesn't exist
[ -d /mnt/root/tmp/balena-supervisor ] || [ -d /mnt/root/tmp/balena-supervisor ] ||
mkdir -p /mnt/root/tmp/balena-supervisor mkdir -p /mnt/root/tmp/balena-supervisor
# 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
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" export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
# Include self-signed CAs, should they exist # Include self-signed CAs, should they exist
if [ -n "${BALENA_ROOT_CA}" ]; then if [ -n "${BALENA_ROOT_CA}" ]; then
if [ ! -e '/etc/ssl/certs/balenaRootCA.pem' ]; then if [ ! -e '/etc/ssl/certs/balenaRootCA.pem' ]; then
echo "${BALENA_ROOT_CA}" > /etc/ssl/certs/balenaRootCA.pem echo "${BALENA_ROOT_CA}" >/etc/ssl/certs/balenaRootCA.pem
# Include the balenaRootCA in the system store for services like Docker # Include the balenaRootCA in the system store for services like Docker
mkdir -p /usr/local/share/ca-certificates mkdir -p /usr/local/share/ca-certificates
echo "${BALENA_ROOT_CA}" > /usr/local/share/ca-certificates/balenaRootCA.crt echo "${BALENA_ROOT_CA}" >/usr/local/share/ca-certificates/balenaRootCA.crt
update-ca-certificates update-ca-certificates
fi fi
fi fi