2015-11-19 13:11:17 +01:00
|
|
|
source $stdenv/setup
|
|
|
|
|
2017-05-26 18:06:24 +02:00
|
|
|
mkdir -p /var/lib/docker
|
|
|
|
mkfs.ext4 /dev/vda
|
|
|
|
mount -t ext4 /dev/vda /var/lib/docker
|
2016-01-27 20:48:04 +01:00
|
|
|
|
2017-05-26 18:06:24 +02:00
|
|
|
modprobe virtio_net
|
|
|
|
dhclient eth0
|
2015-11-19 13:11:17 +01:00
|
|
|
|
2017-05-26 18:06:24 +02:00
|
|
|
mkdir -p /etc/ssl/certs/
|
|
|
|
cp "$certs" "/etc/ssl/certs/"
|
2015-11-19 13:11:17 +01:00
|
|
|
|
2017-05-26 18:06:24 +02:00
|
|
|
# from https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount
|
|
|
|
mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
|
|
|
|
cd /sys/fs/cgroup
|
|
|
|
for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do
|
|
|
|
mkdir -p $sys
|
|
|
|
if ! mountpoint -q $sys; then
|
|
|
|
if ! mount -n -t cgroup -o $sys cgroup $sys; then
|
|
|
|
rmdir $sys || true
|
2015-11-19 13:11:17 +01:00
|
|
|
fi
|
2017-05-26 18:06:24 +02:00
|
|
|
fi
|
|
|
|
done
|
2015-11-19 13:11:17 +01:00
|
|
|
|
2017-05-26 18:06:24 +02:00
|
|
|
# run docker daemon
|
|
|
|
dockerd -H tcp://127.0.0.1:5555 -H unix:///var/run/docker.sock &
|
2015-11-19 13:11:17 +01:00
|
|
|
|
2017-09-04 10:52:16 +02:00
|
|
|
until docker ps 2>/dev/null; do
|
2017-05-26 18:06:24 +02:00
|
|
|
printf '.'
|
|
|
|
sleep 1
|
|
|
|
done
|
2015-11-19 13:11:17 +01:00
|
|
|
|
2017-05-26 18:06:24 +02:00
|
|
|
rm -r $out
|
2015-11-19 13:11:17 +01:00
|
|
|
|
2017-05-26 18:06:24 +02:00
|
|
|
docker pull ${imageId}
|
|
|
|
docker save ${imageId} > $out
|