borgesnotes / pishrink-docker

Automatically shrink a Raspberry Pi image in order to reduce the final image size.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PiShrink dockerized

PiShrink automatically shrink a Raspberry Pi image in order to reduce the final image size.

It's great for saving disk space or sharing your Pi image on the Internet.

This project is a dockerized version of the PiShrink bash script by Drew Bonasera.

Release Docker License

Usage

  1. Make a copy of a Raspberry Pi SD card that you want to shrink (see instructions here).

  2. Using the Terminal, access the directory containing the Raspberry Pi image:

    cd ~/Directory-with-RPi-image
  3. Run PiShrink dockerized:

    docker run --privileged=true --rm \
        --volume $(pwd):/workdir \
        borgesnotes/pishrink \
        pishrink -Zv IMAGE.img NEW-IMAGE.img

PiShrink options

pishrink [-adhrsvzZ] IMAGE.img NEW-IMAGE.img

-s      Do not expand filesystem when image is booted the first time
-v      Enables more verbose output
-r      Use advanced filesystem repair option if the normal one fails
-z      Compress image after shrinking with gzip
-Z      Compress image after shrinking with xz
-a      Compress image in parallel using multiple cores
-d      Write debug messages in a debug log file

If you specify the NEW-IMAGE.img parameter, the script will make a copy of IMAGE.img and work off that. You will need enough space to make a full copy of the image to use that option.

Check out PiShrink GitHub for more details.

Docker Hub

Author

License

The source code is licensed under the MIT license.

The content of this project itself is licensed under the Creative Commons Attribution 4.0 International.

About

Automatically shrink a Raspberry Pi image in order to reduce the final image size.

License:MIT License


Languages

Language:Shell 87.9%Language:Dockerfile 12.1%