-
Notifications
You must be signed in to change notification settings - Fork 65
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
Thoughts on automation? #36
Comments
@Mahoney That container idea is quite interesting and if you manage to get it working, I'm happy to add it to the project. An alternative would be to write a scheduled launched script which checks if the ifaces are up and runs if not. Either of these if made by someone I'm happy to add it to the project and make it a one-off installable service. As for routes, this is a per-project thing and someone could be running multiple projects at the same time, so I believe it belongs there. What I have been doing lately is wrapping docker into my own management tool for nodejs which handles the up command and routes for me when a project is started. If you get the container idea working, we could make and push up a configurable container which creates these routes etc for us and every project that needs it can put it as an auto-restart service within their docker-compose file. I quite like the ideas you have proposed, so I will look into that a bit and see what can be done. It would remove the last of the automation nuisances we have with this system ^_^ |
I'll try and get it into a more manageable form, but I've spiked it and this works:
|
On linux I think all the networks using the bridge driver are addressable from the host, so I'd been planning on parsing the output of |
Last thing I thought of was to bundle this all up in a brew recipe that would depend on docker for mac & tuntap, so setting up docker for mac with addressable containers would be a one line brew install. |
FWIW, I've got this working: with And a script to automatically create the routes: Notice the inadequacies documented in |
I've packaged this up in my own brew tap, so you can install it as so: brew install mahoney/tap/docker-tuntap-osx Note the instructions in the caveats, you have to sudo chown a couple of things & do a brew services start. You can get feedback thus: tail -f /usr/local/var/log/docker-lifecycle-listener.log I'd like to publicise this more widely (e.g. on the #docker-desktop-mac slack channel and on the docker/for-mac#155 discussion), if @AlmirKadric is OK with me doing so. |
@Mahoney sorry for the late reply
Go nuts, MIT FTW ^_^ I recently started another project which needs me to use docker like this on mac again Really annoying though that docker still hasn't addressed these issues within their own project -_- |
Installed this yesterday, in the absence of docker/for-mac#155 ever being addressed, and discovered it works perfectly, despite me being on Catalina (10.15.7) (so why can't Docker just fix it?!). Thanks so much! I've been wanting to make it easier to switch back and forth between running tests and the application under test on the host machine or inside docker, as it's so much faster to change things running locally, and much easier to debug them too.
However, I'd really like to automate running docker_tap_up.sh. Anyone got any thoughts on how to do it reliably? I can't find any hook that will trivially run a script when docker for mac (re)starts.
My only idea is to write a docker image that will, on start, use a mounted, named pipe to run commands on the host to run docker_tap_up.sh. Then run that image with
--restart always
(I can justify it running in the background forever - it can listen to network creation events to create the necessary routes on the host).But that seems quite an arduous solution to write... anyone have any better ideas?
The text was updated successfully, but these errors were encountered: