docker build speed up with tmpfs

Aloha,

just tldr:

stop your docker service and create tmpfs disk on /var/lib/docker/{tmp|containers|aufs}

/etc/fstab
tmpfs /var/lib/docker/tmp tmpfs defaults,size=8G 0 0
tmpfs /var/lib/docker/containers tmpfs defaults,size=8G 0 0
tmpfs /var/lib/docker/aufs tmpfs defaults,size=8G 0 0
mount -a

start your docker service. This should speedup your docker build process significantly!

 

„docker build“ takes usually a very long time, even if it is just a COPY or a RUN. Before the tmpfs change my docker builds did take about ~15 min, now its just 2-4 min! Keep in mind that you need a farly amount of ram in your Server/PC/Notebook for this to work eg min 16GiB in this setup!

Kommentar verfassen