Homebrew, but with Docker images
github.com
github.com
Don't get me wrong, for running services without worrying about their dependencies I couldn't be happier than I am with Docker and the slew of tech that's built up around containers. This, however, is a very complicated solution to a really simple problem.
"All problems in computer science can be solved by another level of indirection, except of course for the problem of too many indirections."
https://mobile.twitter.com/bfirsh/status/824688876056895489
Agreed it's a bit silly for things like jq, but I wanted to see how far I could stretch it. My long-term goal is to have Docker as the only thing installed on my laptop. ;)
Instead of two levels of package management (virtualenv + apt-get), you have one; a docker image.
5MB + REST: oh heck yes. And far slower to start up (though fast enough for most purposes - it's nothing like what it was with VirtualBox). For problematic things like mysql though, I'm thrilled to pay that cost rather than fight with the config / linking / etc song and dance every single time.
For services (like mysql), though, I agree with you fully. Docker is a wonderful solution in that space, because the savings justify the overhead. For wget and jq? Not so much.
[1] https://docs.docker.com/docker-for-mac/#/what-to-know-before...
Anyway. It's pretty clear this is mostly an experiment to see how far it can go, not making any claim to what you should use it for. I think we can agree it's pretty neat, if a bit silly sometimes?
EDIT: README.md says It's like Homebrew, but everything you install is cleanly packaged up in a Docker image.
Homebrew already cleanly packages up programs and libraries in plain and simple Unix directories.
What am I missing?
But what you described is literally "the worst case scenario is as bad as before (building my own images), but it would commonly be better". I'll take that any day.
Also, a lot of apps don't need a full linux distro shipped with them. If your binary is statically linked (like, for example, anything written in Go), the docker image can start from scratch, resulting in an image only a few megabytes large and with no issues like you outline.
No its not. Before you might just have to rebuild openssl yourself. Now you need to rebuild openssl for every docker image you use and rebuild every one of those docker images.
Guess how many docker images will make or accept TLS connections. That's how many you will need to maintain the infrastructure to build yourself to respond to openssl vulnerabilities if you run any kind of business that requires good security.
Vendoring (the go and container model of shipping software) is great when you work with perfect upstream devs. Otherwise it effectively means you have to build it yourself with patched dependencies for fixes and hope it works.
Wait until you run into a compat issue between the code and a patched dependency and the upstream dev says "won't fix" because you're not deploying the container provided and the security risk isn't addressed because it "doesn't seem that bad".
Still, it would be good to have something in between a packaging system and containers, so the whole repo of images could be quickly rebuilt on top of a new base image with an updated library (mixed-in image).
Since base images are shared, it would be the best of both worlds.
Generally though, this should only require patching images that provide openssl, which should be expected to stay up to date, not the utilities which use openssl. The utilities should be picking an openssl-providing parent image - assuming that's the case, you'd just rebuild. That would pull in the new openssl image, rebuild against that newer target, and that'd be the end.
The only real dependency is OverlayFS, but that will stabilise eventually.
Obviously YMMV, but in a Dockerized world the required steps would be: 1) upgrade the OS, 2) maybe update Docker
And that's it.
Lots of pythons versions, installed everywhere, and something broke somewhere. Then it comes the day I need a package, and homebrew give me that finger. There is, certainly, no way I can debug this problem since the debug log is a 5,000 line of incomprehensible gibberish.
This solution, looks like it consumes lots of resources. Well, resources are cheap these days. And I expect the next Macbook to have a more powerful CPU and at least 32GB of Ram. So consuming resources is the least of my worries.
My workflow today already consists of 8 docker machines. Every product is a machine and each machines has several containers. The dev deployment is a bash file that create and run these containers. I don't even need a full backup anymore! Everything is backed in Github and reproducible given enough internet bandwidth.
The next logical step is to have whalebrew; and thus all my unix/linux utilities are now contained in Docker too. My MacOs fresh install will have: Chrome, MacVim and Docker.
Now if Safari is as good as Chrome and a superior Vim (to Macvim) could be installed through a Docker container, my fresh MacOs install will only has Docker!
- this had the potential to use a lot of disk space by pulling many different base layers
- are UIDs inside the container forced to match the current user UID? The container can run anything as root. If the container writes a file with root, host will have to `chown` to use it
- It looks like only `pwd` is mounted. What if a command references a file outside of `pwd`, like ../file.txt
The concept is neat but the issue with root is a huge security concern. What about instead providing a single image with proper permissions? Then installing packages inside of that container? You could even create different instances of the container. This would also solve the disk size issue since the base image would always be the same. And since you trust the image, you could mount `/` into it to allow commands outside `pwd`
Long run, I'm interested. Hope it heads some where.
'Cmd.io, or “Command IO” as we pronounce it. Cmd.io will let you use and share commands for the terminal, as a service, over SSH.' http://gliderlabs.com/devlog/2016/announcing-cmd-io/