Skip to content

Instantly share code, notes, and snippets.

@aputs
Last active October 29, 2016 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aputs/1e2d58b507de37d7bae1 to your computer and use it in GitHub Desktop.
Save aputs/1e2d58b507de37d7bae1 to your computer and use it in GitHub Desktop.
tar docker image (squash)
docker_root=/var/lib/docker/btrfs
subvolumes=subvolumes
docker_image=aputs/archlinux
tar_file=/tmp/image.tar.gz
# tar
cd $docker_root/$subvolumes/$(docker inspect --format='{{.Id}}' $docker_image)
tar --exclude={'.','..'} -Pcvzf $tar_file .* *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment