/var/lib/boot2docker/bootlocal.sh
fits your need probably, it will be run by initial script /opt/bootscripts.sh
And bootscripts.sh
will also put the output into the /var/log/bootlocal.log
, see segment below (boot2docker 1.3.1 version)
# Allow local HD customisation
if [ -e /var/lib/boot2docker/bootlocal.sh ]; then
/var/lib/boot2docker/bootlocal.sh > /var/log/bootlocal.log 2>&1 &
fi
One use case for me is
I usually put shared
directory as /c/Users/larry/shared
, then I add script
#/bin/bash
ln -s /c/Users/larry/shared /home/docker/shared
So each time, I can access ~/shared
in boot2docker as the same as in host
see FAQ.md (provided by @KCD)