mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2026-01-11 21:10:25 +01:00
Is there anyway to have a fully configured MacOS container with ssh without using any graphical interface (no vnc)? #86
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 @UliPrantz on GitHub (Nov 7, 2020).
I just need a fully configured MacOS container for CI/CD is there anyway to get a container without going through the setup process in which I assume I need a vnc connection?
In other words is there a way to programmatically setup the container from the beginning? I read through the README.md and think even if I build it myself I need to connect to a vnc server once and go through the initial setup process, is it right? Would there be any way how to automate this process?
@L-U-C-K-Y commented on GitHub (Nov 8, 2020):
Check this issue, is this helping: https://github.com/sickcodes/Docker-OSX/issues/83
@UliPrantz commented on GitHub (Nov 10, 2020):
Not really I think. They consider to use the vnc version to setup the container and once it's setup they auto boot into it. But I also want this initial setup to be automated. Am I missing something? The documentation is a little bit too hard for somebody that has not much experience with virtualization, sorry.
@iambenmitchell commented on GitHub (Nov 11, 2020):
You can setup the container and then commit it.
Then in the future run it from your commit and it will be pre set up
@sickcodes commented on GitHub (Nov 13, 2020):
Can't automate it, as you have to accept Apple's End User License Agreement.
Once you've accepted it, you can docker commit, and copy the .img anywhere you like. You can even import it into virt-manager.
@weskerfoot commented on GitHub (Nov 24, 2020):
I did the following:
docker committhe imagedocker runwith-e EXTRA="-monitor telnet::45454,server,nowait -nographic -serial nulland it works
If you wanted to automate the whole setup from scratch then it would be challenging, but I don't see the point, just create a new image and host it on docker hub yourself.
@sickcodes commented on GitHub (Nov 24, 2020):
@weskerfoot great work. Do you want to submit a PR? You can add a CI/CD Solution heading to the readme if you'd like.
😎 Make sure to write "host it privately"!
As a committed image has a ton of private information ❤️
@sickcodes commented on GitHub (Nov 24, 2020):
The full installation automation can be done with xdotool auto-clicking but I don't encourage anyone to spend any time doing that as it's not an ideal solution.
By far the best way is to do exactly what @weskerfoot has done,
docker commityour image when it's ready for spinning up and spinning down, as well as duplicating.Mind your keys in the image!
Also you can do screenshots and things like that
docker exec container sudo pacman -Syyu scrot --noconfirmThen you can take screenshots inside the container using
scrotto see what it's up to. Alternatively, you can use this inside OSX itself, but never forget there is an X server running in the Arch base image so you can do anything as normal inside there.@weskerfoot commented on GitHub (Nov 24, 2020):
@sickcodes
Yes, definitely make sure to use a private registry. I am using AWS ECR for this.
Also, yeah I can make a PR. Do you want me to do it as a separate Dockerfile? The plist file for starting up sshd would have to be created manually after you've installed OSX obviously. It basically amounts to using LaunchDaemon to run
sudo systemsetup -setremotelogin onin a script at boot.There is also the matter of slimming down the image after everything is set up, which you can use diskutil to do pretty easily I found
Edit: I'll just update the readme for now with the method I used
@sickcodes commented on GitHub (Mar 7, 2021):
Added
27d7496a70CTRL F the README for
OSX_COMMANDS