by leftnode · 5y ago · 0 comments
But, virtual servers I can understand. I've been using Vagrant since 2013 and it ... just works. We've built our own custom box to standardize our development environment as well.
If there is one company and person I'd like to mimic, it's Hashicorp and Mitchell. Work to build an amazing product or products, get it ready for a sale or IPO, and then transition into an IC to continue doing what I love: hacking.
Congratulations on the success!
You can basically just treat it like a package manager and config-assistant. It's often easier(!) to configure a Docker image than the corresponding package, or set of packages, in your typical distro. In part this is because documenting where all the config files and data live just kinda falls naturally out of creating a half-decent image, and in part because good images often put commonly-modified config options—which may correspond to multiple changes in the config files—in single environment variables, for common use cases.
The main gotchas are making sure you've mapped any data directories to something outside the image (which is trivial to do with command-line options, if you prefer writing bash scripts, or in docker-compose yaml, and very easy to test—add some data, destroy the image, bring it back up, is your stuff there? Yes? Good, you got it) so data isn't lost if the image is replaced or destroyed, and making sure your port mapping isn't doing anything dumb like exposing ports it shouldn't on a public interface.
You don't have to use swarm or even actually learn how images work. You can run your application outside of it and just use pre-built official images from PostgreSQL, or whatever, and enjoy a nice, cross-distro, also-sorta-works-on-Mac-and-Windows, consistent set of project daemon dependencies, with an interface that's the same on Red Hat or Gentoo or Arch or wherever, and far more up-to-date than major stable distros (so you could use Debian Stable for simplicity and reliability, for example, but run the latest MySQL or ElasticSearch or whatever on it without mucking with the distro's packages).
I find this massively simplifies server config scripts (Ansible, or bash, or whatever) since I can confine those to fairly generic housekeeping things and put daemon config in much-tidier Docker scripts or yaml.
My original reply was going to be something along the lines of "Bwahahahaha" followed by a comparison of how many seconds it takes to `pip3 install torch` vs how many hours you'd rip your hair out trying to get that running in Docker, let alone on a GPU, and let alone in a way that you can actually develop on it.
Perhaps it's easier to say, "We're not smart." Like Racket, Docker is a marvelous tool, and I'm sure a lot of smart people use it in some incredible ways.
I'll be 34 in Feb. Do I want to spend a month trying to force myself to use Docker for no apparent reason?
At my first job (gamedev), one of my coding heroes happened to work there. One thing he said really bugged me: "Shaders are a young person's game." By "hero" I mean that he single handedly wrote most of the Planetside 1 client code, as well as having developed many other titles that I grew up playing on MPlayer. (God help you if you know what MPlayer was.)
I tried explaining to him, no no, you see, it's not so bad! You can do it! I believe in you. Once you put in a little effort, you'll understand all the parts, and you'll see there's really not that much to it.
Yeah, uh, I was 19. He was like 40. I get it now.
I've personally deployed multiple services to production whose reliability can be measured in years: https://status.shawwn.com/
Sure, none of those are too impressive. Except the one I can't talk about, ha. But they're all variations on "get the server running, make sure the process is simple, make sure it's fail-safe, and put failsafes in place to notice if it breaks."
To my surprise, they almost never break. Isn't that marvelous? Here's me, someone inching closer and closer over the hill, delivering robust software that lasts years. Hell, you can even see for yourself: https://tags.tagpls.com/uptime
508d 00h 04m 14s
Not bad.Sure, I'm being unfair. Because you'll rightly say that there's a world of difference between this and the situations DOcker's designed to solve.
And yet, as I go from company to company, I keep being surprised to find zero people using Docker. Isn't that strange? My wife just got a job at a YC co. I'll ask her whether anyone there uses Docker either. Maybe they do.
Docker's stolen days of my life for no gain. Painful days, because they were days when I was really into hacking, and I could've been busily building a big beaver dam instead of learning infrastructure that none of my colleagues ended up using.
Docker is a time vampire. It's "Nerd Snipe: The Game." You'll want to play with it, and it'll give you just enough happiness to keep you going. But, like a cat, the love is one-way. If Docker were a person, they would totally ditch you on your birthday.
It was much more satisfying to write this than to spend that time staring at yet another damn variation of "how do I forward the port properly?" torrent of blog posts from the legions of developers that Docker has managed to curse, by making the impressive decision to eschew simplicity in favor of being Smart with a capital-S.
But hey, Docker will be around longer than I will, I'm sure. So it'll get the last laugh. In seriousness though, you can get by without it, which is pretty remarkable -- almost as remarkable as it was to try out vagrant and discover that it's the polar opposite of Docker's philosophy.
The difference is easy to spot: Vagrant just works.
It's just excellent for replacing other methods of installing & configuring daemons you're dependent on, especially if you're already in a "doing things wrong" kind of space (and hey, you and me both).
Very nearly all of my use of it doesn't involve modifying or customizing containers at all, and just lets me use one set of commands to manage packages across most platforms and pin them to my desired version without having to care much about the underlying OS, for dependencies like database systems, entire software packages that I don't need to modify aside from config (as in my personal use of it for things like Jellyfin and a Minecraft server), et c.
My server at home runs Debian Stable. Very little of what I use it for is available in the official repos at all. Docker, though? They're all available at the latest version, with a bunch of older versions available too, just as easily. And if I switch distros out from under them, or upgrade Debian, nothing happens. I just run the same stuff, and it works.
Well that's pretty astounding. I work on a service at a Very Large Company that intercepts each docker container as it passes into our production-deployable repos and it inspects about 100 containers per hour. This isn't every build, it's every actual prod deployment. Mind you, we have lot of services doing deployments, but the ones that aren't using docker are in the vast, vast minority.
I think one thing docker brings you is consistency. At our level of scale, you can't be doing "pip install"s on random hosts or you'd never be able to say what state everything is in. Docker isn't the only way to do this, of course, but it's one way. And I'm super happy that other teams the produce tools built on piles of python now package them as docker containers on a standard base so I can just run them rather than spend a day untangle my completely-hosed python environment every few months.