Skip to content

Commit 1c7ad47

Browse files
committed
feat(builder): detect and use overlay as graph driver if supported
1 parent 13572c9 commit 1c7ad47

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

builder/image/bin/boot

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ CONFD_PID=$!
5353
# remove any pre-existing docker.sock
5454
test -e /var/run/docker.sock && rm -f /var/run/docker.sock
5555

56+
# force overlay if it's supported
57+
mkdir --parents --mode=0700 /
58+
fstype=$(findmnt --noheadings --output FSTYPE --target /)
59+
if [[ "$fstype" == "overlay" ]]; then
60+
DRIVER_OVERRIDE="--storage-driver=overlay"
61+
fi
62+
5663
# spawn a docker daemon to run builds
57-
docker -d --bip=172.19.42.1/16 --insecure-registry 10.0.0.0/8 --insecure-registry 172.16.0.0/12 --insecure-registry 192.168.0.0/16 --insecure-registry 100.64.0.0/10 &
64+
docker -d --bip=172.19.42.1/16 $DRIVER_OVERRIDE --insecure-registry 10.0.0.0/8 --insecure-registry 172.16.0.0/12 --insecure-registry 192.168.0.0/16 --insecure-registry 100.64.0.0/10 &
5865
DOCKER_PID=$!
5966

6067
# wait for docker to start

contrib/coreos/user-data.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,14 @@ coreos:
8989
ExecStartPre=/usr/sbin/modprobe nf_conntrack
9090
ExecStart=/bin/sh -c "sysctl -w net.netfilter.nf_conntrack_max=262144"
9191
- name: load-overlay-module.service
92+
command: start
9293
content: |
9394
[Unit]
9495
Description=Load overlay module before docker start
9596
Before=docker.service
9697

9798
[Service]
98-
ExecStart=/bin/bash -c "modprobe overlay"
99+
ExecStart=/bin/bash -c "lsmod | grep overlay || modprobe overlay"
99100
write_files:
100101
- path: /etc/deis-release
101102
content: |

0 commit comments

Comments
 (0)