Use Docker volumes (or binds) #57

Closed
opened 2025-12-28 23:22:44 +01:00 by adam · 3 comments
Owner

Originally created by @jlxip on GitHub (Jul 8, 2020).

For better persistence, along with using docker start, either Docker volumes or binds should be mentioned in the README to back up the virtual hard drive, transfer it to another computer, or, even more important, allowing uncomplicated qemu configuration changes. This shouldn't be too far from adding a new -v parameter to the launch command, and will make a difference.

Originally created by @jlxip on GitHub (Jul 8, 2020). For better persistence, along with using `docker start`, either Docker volumes or binds should be mentioned in the README to back up the virtual hard drive, transfer it to another computer, or, even more important, allowing uncomplicated qemu configuration changes. This shouldn't be too far from adding a new `-v` parameter to the launch command, and will make a difference.
adam closed this issue 2025-12-28 23:22:44 +01:00
Author
Owner

@sickcodes commented on GitHub (Jul 8, 2020):

In the original version, I had OSX-KVM folder move to another location, and then mount voulme, move across.
mv in a Dockerfile is actually a copy to new layer, so build time was slow.

I abandoned the idea because the user would have to:
Copy a large .img file from the Docker container to their disk.
OR
They would have to build the OSX-KVM themselves first.

If you have a third idea, feel free to suggest or submit a PR.

Here is the original abandoned code if you want to submit a PR:

The below code is not complete.


# Persistent:
#       
#      To keep a permanent disk, use a bind mount.
#      Change /home/user/somefolder to where you want to keep the files.
#      
#      docker run --privileged -p 8888:5901 --mount type=bind,src=/home/user/somefolder,dst=/home/arch/OSX-KVM -it osx-kvm
#      docker run --privileged -p 8888:5901 -v /root/folder:/home/arch/OSX-KVM -it osx-kvm /bin/bash


# stash the folder to /home/arch/stash so when we mount volume, it will bring it to our host
RUN mkdir /home/arch/stash
RUN mkdir /home/arch/stash/OSX-KVM
RUN mv /home/arch/OSX-KVM /home/arch/stash
RUN sudo chown -R arch:arch /home/arch
# this is abandoned test code
CMD cp -r --no-clobber /home/arch/stash/OSX-KVM/* /home/arch/OSX-KVM && ./OpenCore-Boot_custom.sh"

@sickcodes commented on GitHub (Jul 8, 2020): In the original version, I had OSX-KVM folder move to another location, and then mount voulme, move across. `mv` in a Dockerfile is actually a copy to new layer, so build time was slow. I abandoned the idea because the user would have to: Copy a large .img file from the Docker container to their disk. OR They would have to build the OSX-KVM themselves first. If you have a third idea, feel free to suggest or submit a PR. Here is the original abandoned code if you want to submit a PR: **The below code is not complete.** ```dockerfile # Persistent: # # To keep a permanent disk, use a bind mount. # Change /home/user/somefolder to where you want to keep the files. # # docker run --privileged -p 8888:5901 --mount type=bind,src=/home/user/somefolder,dst=/home/arch/OSX-KVM -it osx-kvm # docker run --privileged -p 8888:5901 -v /root/folder:/home/arch/OSX-KVM -it osx-kvm /bin/bash # stash the folder to /home/arch/stash so when we mount volume, it will bring it to our host RUN mkdir /home/arch/stash RUN mkdir /home/arch/stash/OSX-KVM RUN mv /home/arch/OSX-KVM /home/arch/stash RUN sudo chown -R arch:arch /home/arch # this is abandoned test code CMD cp -r --no-clobber /home/arch/stash/OSX-KVM/* /home/arch/OSX-KVM && ./OpenCore-Boot_custom.sh" ```
Author
Owner

@sickcodes commented on GitHub (Oct 6, 2020):

I will add the ability to specify an overriding images folder similar to what I did in https://github.com/sickcodes/Docker-eyeOS

@sickcodes commented on GitHub (Oct 6, 2020): I will add the ability to specify an overriding images folder similar to what I did in https://github.com/sickcodes/Docker-eyeOS
Author
Owner

@sickcodes commented on GitHub (Feb 26, 2021):

Added https://github.com/sickcodes/Docker-OSX#quick-start-own-image

@sickcodes commented on GitHub (Feb 26, 2021): Added https://github.com/sickcodes/Docker-OSX#quick-start-own-image
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#57