Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding macOS support via Docker #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

a2f0
Copy link

@a2f0 a2f0 commented Nov 10, 2017

This will allow you to run PiShrink on macOS with a Docker engine installed. I think this will also work on Linux but I haven't tested it.

@revolunet
Copy link

awesome addition thanks 👍

@miathedev
Copy link

miathedev commented Jun 24, 2019

It works on Linux 👍 (But i wouldnt privileged the container in the compose-file)

@pablobuenaposada
Copy link

pablobuenaposada commented Oct 25, 2019

it works (tested in MacOs but should work everywhere), please merge it
@deepeeess please squash the commits

@a2f0
Copy link
Author

a2f0 commented Nov 6, 2019

@pablobuenaposada commits have been squashed as requested.

@a2f0
Copy link
Author

a2f0 commented Nov 6, 2019

@miathedev on MacOS I get a bunch of errors when I invoke docker-compose without privileged: true in the docker-compose.yml. I did remove privileged: true and re-add it and verify these go away.

WARNING: Image for service pishrink was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
losetup: /pishrink/universal.img: failed to set up loop device: Operation not permitted
Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-f] [-g group]
	[-i interval[d|m|w]] [-j] [-J journal_options] [-l]
	[-m reserved_blocks_percent] [-o [^]mount_options[,...]]
	[-r reserved_blocks_count] [-u user] [-C mount_count]
	[-L volume_label] [-M last_mounted_dir]
	[-O [^]feature[,...]] [-Q quota_options]
	[-E extended-option[,...]] [-T last_check_time] [-U UUID]
	[-I new_inode_size] [-z undo_file] device
Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-f] [-g group]
	[-i interval[d|m|w]] [-j] [-J journal_options] [-l]
	[-m reserved_blocks_percent] [-o [^]mount_options[,...]]
	[-r reserved_blocks_count] [-u user] [-C mount_count]
	[-L volume_label] [-M last_mounted_dir]
	[-O [^]feature[,...]] [-Q quota_options]
	[-E extended-option[,...]] [-T last_check_time] [-U UUID]
	[-I new_inode_size] [-z undo_file] device
mount: /tmp/tmp.92SPHlr0rf: can't find in /etc/fstab.
md5sum: /tmp/tmp.92SPHlr0rf/etc/rc.local: No such file or directory
/pishrink/pishrink.sh: line 63: [: !=: unary operator expected
umount: /tmp/tmp.92SPHlr0rf: must be superuser to unmount.
Usage: e2fsck [-panyrcdfktvDFV] [-b superblock] [-B blocksize]
		[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
		[-E extended-options] [-z undo_file] device

Emergency help:
 -p                   Automatic repair (no questions)
 -n                   Make no changes to the filesystem
 -y                   Assume "yes" to all questions
 -c                   Check for bad blocks and add them to the badblock list
 -f                   Force checking even if filesystem is marked clean
 -v                   Be verbose
 -b superblock        Use alternative superblock
 -B blocksize         Force blocksize when looking for superblock
 -j external_journal  Set location of the external journal
 -l bad_blocks_file   Add to badblocks list
 -L bad_blocks_file   Set badblocks list
 -z undo_file         Create an undo file
resize2fs 1.44.1 (24-Mar-2018)
Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [-b|-s|new_size] [-S RAID-stride] [-z undo_file]

@pablobuenaposada
Copy link

it's a shame nothing gets merged 😢
@deepeeess thanks anyway

@a2f0
Copy link
Author

a2f0 commented Dec 3, 2019

All good I still have hope @pablobuenaposada. No merge conflicts yet 😜

@pablobuenaposada
Copy link

All good I still have hope @pablobuenaposada. No merge conflicts yet 😜

probably a rebase would help?

@a2f0
Copy link
Author

a2f0 commented Dec 4, 2019

I dunno, I'm not a git expert but I've kind of stopped using rebase because it messes with the history. If rebasing would help get this merged I'm wiling to do it.

@pablobuenaposada
Copy link

You can put your commit on top with git rebase -i for example, shouldn't be any problem.
The thing is that there are quite some commits after this one and would be nice to test it with everything up to date.

@Drewsif
Copy link
Owner

Drewsif commented Dec 4, 2019

You don't need to rebase it. I just have not had time to get to this particular issue and test it. It's next on my list for the project though!

@pablobuenaposada
Copy link

pablobuenaposada commented Dec 4, 2019

I think not rebasing is a silly move, you would test it with old code, would work, and you will merge it giving the chance that the new commits mess up the dockerization and having a broken master branch until someone tells you about 🤷‍♂

This is the perfect scenario to do a rebase, nothing will conflict so it's a no brainer.

@Drewsif
Copy link
Owner

Drewsif commented Dec 5, 2019

I would merge in master before I start testing, don't worry about that ;)

@pablobuenaposada
Copy link

well, here you have the first conflict, then can we rebase now?

@a2f0
Copy link
Author

a2f0 commented Dec 27, 2020

@pablobuenaposada @Drewsif I resolved the merge conflict.

@borgesnotes
Copy link

borgesnotes commented Feb 10, 2021

Hey @deepeeess @miathedev @pablobuenaposada you can use PiShrink dockerized | Docker Hub PiShrink:

macOS Setup

  1. Install Docker Desktop on Mac

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

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

cd ~/Directory-with-RPi-image
  1. Run PiShrink dockerized:
docker run --privileged=true --rm \
    --volume $(pwd):/workdir \
    monsieurborges/pishrink \
    pishrink -Zv IMAGE_NAME.img NEW-IMAGE_NAME.img

@miathedev
Copy link

Didnt expect that this issue still exist after this time! @Drewsif what speaks against a merge?

@pablobuenaposada
Copy link

I don't get it honestly, other people are starting to create their own repos with this project dockerized because this is getting postponed again and again.

@Axel-Jacobsen
Copy link

ping @Drewsif! Is it possible to merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants