Skip to content

Commit

Permalink
vm init - detect docker start
Browse files Browse the repository at this point in the history
  • Loading branch information
robwaz committed Nov 15, 2023
1 parent 572be38 commit a57cf26
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions challenge/vm/init
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ find /challenge -name '*.ko' -exec /usr/sbin/insmod {} \;

service ssh start

echo wat > /tmp/hello
if [ -e /challenge/target ]; then
# /var/lib/docker needs to be ext4 in order to use overlayfs
dd if=/dev/zero of=/tmp/data bs=1M count=0 seek=2000
yes | mkfs.ext4 -O ^has_journal /tmp/data
mount /tmp/data -o X-mount.mkdir /var/lib/docker

# get my cgroup mounts into /sys/fs/cgroup
cgroupfs-mount

sudo dockerd > /dev/null 2>&1 &
fi

if [ -e /usr/sbin/docker-init ]; then
exec /usr/sbin/docker-init /bin/sleep -- 6h
else
Expand Down

0 comments on commit a57cf26

Please sign in to comment.