How To: Increase storage by locating Docker resources onto an SD Card

Docker images and containers can consume hundreds of megabytes of storage, and in some cases can exceed the internal eMMC limitations. One solution is to locate the docker resources to an SD card which provides a great deal more storage (up to 32GB). Here are the steps to implement this approach.

Pre-Requisites:

  1. PFC200 or Edge Controller
  2. Blank SD Card (up tp 32GB)
  3. Docker installed on the controller

Steps:

  1. Insert the blank SD card into PFC200 or Edge Controller card slot reader.
  2. With a web browser, connect to the devices WBM. Under Configuration > Mass Storage menu, format the SD with EXT4 filesystem and with the name ‘docker’. (You can use any name you like, but change the name in step 4 below.

Click Continue
image

  1. Use a secure shell connection (ssh, putty, etc) to connect with the controller and then type the following in the CLI.

nano /etc/docker/daemon.json

  1. Edit the docker root point to the sd card rather than the default location.

Edit the line

“data-root”:“/home/docker”,

Change to:

“data-root”:“/media/docker”,

Save the file with Ctrl-X, then Y, then
5. Power cycle the controller

reboot now

image

  1. Check the size of the docker directory with the command:

df -h

  1. You may consider putting masking tape or a sticker over the SD Card access cover to prevent accidental removal. Remember all the docker images & containers will now reside on the SD Card and should not be removed once this procedure is followed.
1 Like