Skip to content

Instantly share code, notes, and snippets.

@dirkakrid
Forked from aputs/tar-docker-image
Created October 29, 2016 23:58
Show Gist options
  • Save dirkakrid/1aadf95005327a9fcd16271770c94cfc to your computer and use it in GitHub Desktop.
Save dirkakrid/1aadf95005327a9fcd16271770c94cfc 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