From 9d1b46a30b78626863779200c4bd0a1b184d6edf Mon Sep 17 00:00:00 2001 From: Dan Sullivan Date: Sat, 26 Dec 2020 21:20:25 -0500 Subject: [PATCH] adding macOS support via Docker --- .dockerignore | 1 + Dockerfile | 3 +++ README.md | 10 ++++++++++ docker-compose.yml | 9 +++++++++ 4 files changed, 23 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a89285e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +*.img diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ea7aae1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM ubuntu:latest +RUN apt-get update +RUN apt-get install parted udev -y diff --git a/README.md b/README.md index 43d07b8..41bb4f1 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,16 @@ The filesystem on /dev/loop1 is now 773603 blocks long. Shrunk pi.img from 30G to 3.1G ``` +## macOS Support ## + +It is not currently possible to run PiShrink natively in macOS. Included in the repo is a `Dockerfile` and `docker-compose.yml` that should allow you to run PiShrink on a Docker host, including a macOS one. + +Note 1: The cloned repo is mounted as a Docker host mount so any output file should be created under `/pishrink` to have it persisted on the host. + +Note 2: Only `*.img` is present in the provided `.dockerignore`, if you don't use this extension the created container will include your image, potentially consuming a significant amount of disk space. + +Example: `docker-compose run pishrink /pishrink/pishrink.sh /pishrink/someimage.img` + ## Contributing ## If you find a bug please create an issue for it. If you would like a new feature added, you can create an issue for it but I can't promise that I will get to it. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..89c770a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '2' + +services: + pishrink: + build: . + volumes: + - .:/pishrink + - /dev:/dev + privileged: true