by usrbinbash · 4y ago · 0 comments
Unsurprising, really. The usefulness of it cannot be overstated.
Doesn't even matter if its used anywhere in the deployment chain; simply having the ability to pull up a replica of almost any *nix environment on my laptop in mere seconds, using it for tests, and then throwing it away resetting it again in mere seconds is beyond awesome, no matter if what I'm working on then goes into a huge complicated deployment chain, or is shoved onto some on-premises, zero-abstractions, baremetal server.
And how is it all configured? Plain text files. How is it controlled? Command Line. Meaning I can script it every way I want, using the tools I already have and use. Doesn't get in the way, doesn't demand that I work around it...it works with me and my tools in the same way they already work together.
Oh, and of course, good bye and good riddance to the days when I had to install and configure local RDMS for tests. Everything I use has an official image, so I just write some small setup script, a Dockerfile, knit everything together in a docker-compose.yml and presto, done: Application stack is up and running.
To me, Docker is as essential as my text editor these days.
I then have another set of docker images for making package repositories and signing everything.
I do have a lot of mostly-redundant dockerfiles in some places, but in others I've managed to leverage m4 to reduce the redundancy (though I'm trying to keep it as slim as possible to avoid the pain of turning everything into a convoluted set of impossible-to-maintain macros).
Before this, I was using Vagrant and Ansible for builds, which was slow, memory hungry, and frustrating to debug. Not to mention that dependencies that needed to be built statically couldn't be easily cached, which comes out of the box with Docker.
Furthermore, in addition to the points you mentioned, it also lets us:
- trivially remap ports to whatever we want (and expose whichever we'd like to the outside)
- easily set resource limits, so your instance of MariaDB doesn't bring the whole server down and make it unresponsive
- abstract away storage, in case you want a specific directory for your backups instead of following HFS (say, just have /app, treating the rest of the server as throwaway)
- perhaps most importantly, your host OS is now separate from the actual containers that you are running, updating/redeploying either becomes a breeze
Recently, I actually decided to build my own containers for all of my personal use cases and it's been an interesting experience: I base everything on a LTS version of Ubuntu and just use apt for getting all of the runtimes (Node, Java, .NET, PHP, Ruby, Python, ...) for my own software, and so far it's a nice experience.All I need is the base Ubuntu image from Docker Hub and the rest is up to me and the regular mirrors/repositories for the software packages in question, most of which can be stored on my own Nexus instance as needed, as well as the whole build process is primarily driven through Gitea, Drone CI and a few "servers" (repurposed old computers with passive cooling) that I have on my desk.
Though for now I also use Bitnami images for databases and such, which are also decent and which I largely just cache on my end: https://bitnami.com/stacks/containers
So what I'm trying to say, is that there's a lot of flexibility that you can enjoy, both in making your own "templates" for web servers, programming languages, build toolchains etc., as well as you can grab pre-made stuff that other people have made, be it on Docker Hub, someone's Nexus/Artifactory/Harbor instance or another registry out there.
Docker and other OCI compatible tools have largely achieved the sort of adoption and widespread usage that projects like Nix and Guix could also benefit from.
That said, I also don't remember the Docker documentation to be very good. For someone that doesn't work with it professionally, what's a good starting point to learn Docker well?
Lets say I want to write a typescript microservice and deploy it to azure as a serverless functions app. I’ll fork our bare metal nodejs project for azure functions, which is essentially the standard azure cli “create nodejs function -typescript -docker” (this isn’t correct syntax but you get it) with the linting and ts-compiling rules we use on all our projects (and an updated image version in the docker file as mentioned). While I build things and run them locally, I don’t use docker, it’s not until I actually want to deploy to azure and setup the release pipeline and trigger it that docker comes into play, but those DevOps steps (also streamlined) aren’t really docker heavy as they simply use the dockerfile that was mostly provided by Microsoft.
I can certainly build and run my micro service as a docker container locally, but I don’t need to. In fact the only times I did was when it failed to build during the azure pipeline but it turned out to be the azure container registry access controls every single time that happened, so these days I almost never “use” docker. In fact I use it so rarely I almost always have to Google command lines.
I know people use docker in many different ways, and that many use things like docker compose, but my point is that you can deploy everything you build with docker and never actually have to care much about docker itself. So maybe you should ask yourself if you really need to learn docker good before you spend too much time on it.
I agree the docker docs are lacking, i basically learned everything by googling stuff, stack overflow and reading some blog posts
meh, I can count on my hand the times it was useful to me.
oh, and having to deal with docker desktop is not fun
To stay sane, just forget it exists until it crashes irretrievably, then reinstall it and repeat. Containers and images being disposable is the whole point anyway.
Umm, I struggle with that. I have Ubuntu machines that run in production. They are VMs that run systemd for some stuff and Docker containers for others. The only way to (easily) replicate such machines on my laptop is via VMs (e.g., Vagrant + VMware), not via Docker only.
I do use Docker a lot... Inside VMs.
I would much rather just spin up all my resources on a dev cloud account using CloudFormation/Terraform, and spend them down when I’m done.
Before I get (rightfully) called out. Yes I work at AWS now. But I also found that just as appealing three years ago when I worked at a 60 person company.
I get why companies are concerned about having improperly licensed software on their machines, as the consequences can be great, but too many have gone too far in the opposite direction, making purchasing anything a long and convoluted process.
You can stop it there.
All the comments I've read complaining about the price were saying basically that. One even explicitly said that if it was cheaper he'd buy it for fun, but since it provided no value, he wouldn't... just to get a thread of people complaining that the price shouldn't change his opinion.