Skip to content

Instantly share code, notes, and snippets.

@Creased
Created December 26, 2017 16:17
Show Gist options
  • Select an option

  • Save Creased/1868c561864e1e77532b030482b91292 to your computer and use it in GitHub Desktop.

Select an option

Save Creased/1868c561864e1e77532b030482b91292 to your computer and use it in GitHub Desktop.
Backup Docker images
#!/bin/bash
OUTPUT="images/linuxkit.tar"
IMG_REGEX="/^(linuxkit)/"
IMG_IDS=$(docker images | awk '{if ($1 ~ '${IMG_REGEX}') print $3}')
docker save ${IMG_IDS} -o ${OUTPUT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment