mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-11 03:16:27 +00:00
44 lines
1.3 KiB
Plaintext
Executable File
44 lines
1.3 KiB
Plaintext
Executable File
#!/sbin/openrc-run
|
|
|
|
export DOCKER_RAMDISK="true"
|
|
|
|
command="${DOCKER_BINARY:-/usr/bin/docker}"
|
|
|
|
pidfile="/run/docker.pid"
|
|
|
|
# Start with networking on both Mac and Hyper-V, but in
|
|
# future change this to use a hypervisor socket.
|
|
DOCKER_OPTS="${DOCKER_OPTS} -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
|
|
|
|
if cat /proc/cmdline | grep -q 'com.docker.driverDir'
|
|
then
|
|
DRIVER="$(cat /proc/cmdline | sed -e 's/.*com.docker.driverDir="//' -e 's/".*//')"
|
|
INET=$(ifconfig eth0 2> /dev/null | grep 'inet addr' | cut -f 2 -d ":" | cut -f 1 -d " ")
|
|
[ -d "/Mac/$DRIVER" ] && echo $INET > "/Mac/$DRIVER/ip"
|
|
fi
|
|
|
|
if cat /proc/cmdline | grep -q 'com.docker.database'
|
|
then
|
|
DATABASE="$(cat /proc/cmdline | sed -e 's/.*com.docker.database="//' -e 's/".*//')"
|
|
CONFIG_FILE="/Database/branch/master/ro/${DATABASE}/etc/docker/daemon.json"
|
|
[ -s ${CONFIG_FILE} ] && DOCKER_OPTS="${DOCKER_OPTS} --config-file ${CONFIG_FILE}"
|
|
fi
|
|
|
|
for d in Users Volumes tmp private
|
|
do
|
|
[ -d /Mac/$d ] && mkdir -p /$d && mount --bind /Mac/$d /$d
|
|
done
|
|
|
|
command_args="daemon -p \"${pidfile}\" ${DOCKER_OPTS}"
|
|
|
|
DOCKER_LOGFILE="/var/log/docker.log"
|
|
|
|
start_stop_daemon_args="--background \
|
|
--stderr \"${DOCKER_LOGFILE}\" --stdout \"${DOCKER_LOGFILE}\""
|
|
|
|
depend()
|
|
{
|
|
after 9pudc transfused
|
|
before chronyd
|
|
}
|