-
Notifications
You must be signed in to change notification settings - Fork 695
Open
Description
Use PiShrink on Apple Silicon macOS (via Docker Desktop)
Prerequisite
- Docker Desktop must be installed and running.
Install PiShrink with Docker
- Enter your PiShrink directory
cd ~/PiShrink/Note
I recommend using this directory for permissions and mounting simplicity.
- Build the Docker image
docker build -t pishrink .- Add a pishrink shortcut to your shell
sudo nano ~/.zshrcAdd this at the end:
# pishrink shortcut
pishrink() {
docker run --rm --platform linux/arm64 --privileged \
-v "$PWD":/workdir \
pishrink "$@"
}- Reload your shell
source ~/.zshrcShrink your SD-Card Image
- List external physical disks to identify your SD-card (e.g. /dev/rdisk4)
diskutil list external physical- Unmount the SD-card
diskutil unmountDisk /dev/rdisk4Note
Replace /dev/rdisk4 with the location of your disk.
- Create a raw image of the SD-card
sudo dd if=/dev/rdisk4 bs=4m status=progress of="raspi.img"Warning
I recommend to copy the image to the internal storage of the mac.
Tip
Using rdisk instead of disk, and bs=4m to copy the image fastly. In my case, 64GB in ~25 minutes.
- Eject the SD-card
sync && diskutil eject /dev/rdisk4- Adjust permissions on the image
sudo chmod 777 raspi.img- Run PiShrink to compress
pishrink -zv raspi.img raspi.shrink.imgFeel free to open a discussion if you have suggestions or issues.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels