Files
linuxkit/alpine/packages/mobyconfig/etc/init.d/database-mac
David Sheets 46e4076736 database-mac: clean up /mnt/db after use
Leaving this unnecessary directory in place caused docker/for-mac#1379.

Signed-off-by: David Sheets <dsheets@docker.com>
2017-03-03 13:08:15 +00:00

25 lines
567 B
Plaintext
Executable File

#!/sbin/openrc-run
description="Set up database (OSX)."
depend() {
before docker hostsettings windowsnet
}
start() {
[ "$(mobyplatform)" = "mac" ] || exit 0
ebegin "Setting up database (OSX)"
mkdir -p /Database
mount -t tmpfs tmpfs /Database
mkdir -p /mnt/db
mount -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 db /mnt/db
[ $? -ne 0 ] && rm -rf /Database && printf "Could not mount configuration database\n" 1>&2 && eend 1
cp -a /mnt/db/branch/master/ro/com.docker.driver.amd64-linux/* /Database
umount /mnt/db
rmdir /mnt/db
eend 0
}