Large docker image on small SSD

The Problem

Today I was doing some local testing with OBIEE (Oracle Business Intelligence 12c) and Oracle Database 12 within Docker. Now typically due to the size of the Oracle installers and resource usage I would install these on VMs, but today I am writting deployment scripts – And I need the ability to build up and tear down quickly, over and over.

The problem is, I only have about 20GB diskspace free on my laptop’s SSD. The database image alone takes up 6GB, OBIEE another 6GB, and I still need additional development space. It’s a little too close for my liking.

This is a problem that does not affect me too often, but I figure I better write it down for when I need it again. Usually if I am working with docker for development my typical images only take up about 200MB.

The Solution

Luckily I have a USB-3 external 2TB drive that I use at my desk for when I am working on such large projects.

  1. Stop Docker bash [root@amartin ~]# systemctl stop docker
  2. Backup Docker bash [root@amartin ~]# cp -arp /var/lib/docker{,.bak}
  3. Move Docker to larger disk bash [root@amartin ~]# mv /var/lib/docker /run/media/amartin/LinuxStoreage/
  4. Sym-link it bash [root@amartin ~]# ln -s /run/media/amartin/LinuxStoreage/docker /var/lib/docker
  5. Start Docker [root@amartin ~]# systemctl start docker

This is a temporary fix as I do not carry extra storage around with me. I alter my setup back once this work is all done.

Andrew Martin
Lead BI Infrastructure Architect


comments powered by Disqus