mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2026-01-11 21:10:25 +01:00
How can I adjust the container size following a successful build? #11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ZackaryNisbet on GitHub (Jun 5, 2020).
In order to download Xcode, I need to upgrade to Catalina, which requires more storage than I allocated. I tried wiping my installed image and then reinstalling using the build arguments provided in the readme, but when partitioning the biggest disk on the new installation, I was still only able to use ~34GB despite the arguments to use 50GB.
Since the installation arguments didn't seem to work, I tried to fix this by taking an approach of simply resizing the image post-installation without losing data. I've tried looking through the reference documentation and other sources, but haven't found a solution that has helped me. Is it possible for me to resize my current docker image to increase the storage size? If not, why didn't the arguments change the accessible storage within the container?
For additional information, I'm running Ubuntu 20.04
@Fr0stykiller commented on GitHub (Jun 5, 2020):
I had the same issue with using
--build-arg. Still, Dockerfile looks ok, so you can just change theVERSIONandSIZEin Dockerfile itself and rebuild.@sickcodes commented on GitHub (Jun 5, 2020):
You can pull the .img out of the /var/lib/docker/.... location and play around with the sizes with gparted or something.
https://softwarebakery.com/shrinking-images-on-linux
It’s probably faster to just make a new one
Back it up before you play with it
Should I change the default to 60GB?
@ZackaryNisbet commented on GitHub (Jun 5, 2020):
Yes please. Everyone who builds this will need more than the 32GB to update to Catalina anyways. 60GB would be perfect for me.
@sickcodes commented on GitHub (Jun 5, 2020):
You can change the build args to download Catalina instead of Mojave.
@ZackaryNisbet commented on GitHub (Jun 6, 2020):
Just finished installing Xcode in my docker container with 50GB+. Thanks so much.
@mikob commented on GitHub (Feb 25, 2021):
For anyone else trying to do this, I couldn't get it working with gparted, but I was able to do it this way:
Resize the .img on the host (not sure if it's necessary)
$ qemu-img resize /var/lib/docker/overlay2/.../diff/home/arch/OSX-KVM/mac_hdd_ng.img.img +10GUse the disk utility in MacOS to resize the partition so that it includes the new free space.
@sickcodes commented on GitHub (Feb 25, 2021):
That looks correct! The only other way to resize hfs plus on Linux is using hfsprogs. You can only grow a disk too, cannot shrink, so doing it inside MacOS is the only (safe) way, currently, that I'm aware of.