5 ms·
Putting aside deployment, Docker has been a sheer joy for local development. It provides a complete wrapper for the voodoo and tribal knowledge required to run
by koolba 9y ago
Putting aside deployment, Docker has been a sheer joy for local development. It provides a complete wrapper for the voodoo and tribal knowledge required to run packaged apps.
Gone are the days of building a VM from scratch, following instructions for a previous version of the OS, installing 10 dependencies, installing the app, cursing when it fails half way through, installing another missing dependency, installing the app again, bouncing the server, and then having it all fall apart again because the app isn't registered to run as a service at startup (because you missed that step).
All of this was possible before Docker through Vagrantfiles and the like but Docker made it much cleaner and significantly less resource intensive (i.e. no longer need a VM per item).
- jjawssd 9y agoInstead of writing a build script to put everything together from a solid foundation, Docker implicitly encourages you to perform a succession of random undocumented changes on the original foundation endlessly. Also known as "tribal knowledge." And this is all somehow "cleaner" than build scripts. "Putting aside deployment" means discouraging reproducibility and encouraging book burning.
- amcca029 9y agocan you describe this solid foundation in more detail?
- nur0n 9y agoI think depends on the project, no? You first specify your dependencies, then provide a way to use the dependencies to build the end project. If you don't have to specify the dependencies or the build process to the user, then you can get away with the build process not being well defined. Docker is a win for 'easy installation', but I wonder if it degrades the quality of projects which rely on it?
- kenforthewin 9y agoNo, putting aside deployment means he was talking about the benefits of Docker for local development instead of the benefits of Docker for deployment. As to your talk of a build script, this is what the Dockerfile is for, and it is heavily documented.
- jjawssd 9y agoCorrect, but a Dockerfile is not the only way to create a docker image.
- unsignedinteger 9y agoPacker has a docker-builder which constructs docker images without a dockerfile, found it useful for quickly converting between creating AMIs and Docker images for EC2.
- deleted 9y ago[deleted]
- chaostheory 9y agoYes, imo Docker makes it possible to migrate to Windows 10 from Mac OS and Linux
- jazoom 9y agoPlus WSL. That makes so much pain go away.
- SubuSS 9y agoI have just barely fiddled with docker/kube - run into vagrant in one instance. I thought it was the reverse -https://www.quora.com/What-is-the-difference-between-Docker-and-Vagrant-When-should-you-use-each-one https://www.quora.com/What-is-the-difference-between-Docker-... Vagrant can mimic multiple OSs while containers are stuck to host os - What am I missing?
- mastax 9y agoDocker for Windows/macOS run containers inside of a Linux VM, so nothing changes there. There's also Windows Server Containers which are what they sound like.
- apple4ever 9y agoThis is why you do config management. Here, our Vagrant builds are exactly like our development and production servers. Its literally the same config to run them both, with just variables to differentiate as needed.
- djb_hackernews 9y agoDocker doesn't imply not having config management. In fact for our infrastructure that was using puppet to build vms, we just run puppet as part of `docker build` instead. Still using config management and our prod, staging and dev environments run the same exact blobs.
- geerlingguy 9y agoSometimes; and tools like Ansible Container can help have the best of both worlds. But for every time I see someone using actual configuration management and best practices for reproducible Docker architecture, I see a hundred times when there are brittle and convoluted shell scripts or worse, entire application definitions in a 500+ line Dockerfile (which is neither configuration management nor scripts. At least the scripts are somewhat more portable and maintainable!)
- derefr 9y agoYour argument falls down when it's not your development-time build, but some third-party's. Docker allows you to basically treat "other people's daemons" the way most programming runtimes treat "other people's libraries": as something you can just toss into a dependency spec file and have "pulled in" to your program during build. With Vagrant, I still need to figure out how to install e.g. Postgres, or Redis, or whatever, into the Vagrant VM (usually using salt/chef/ansible/etc.), or—much more rarely, because this isn't "idiomatic"—I'll find a Vagrantfile for someone else's virtual Postgres appliance VM. Which I then need to integrate into my virtual-network architecture as its own separate VM with its own lifecycle management et al. With Docker, my app's image just depends on the postgres:9.6 Docker image, and so when I start my app, a copy of Postgres is downloaded and started as well. My app "owns" this container: the config management for what version of Postgres is running is done by my app (just like a library dependency), rather than the resulting container being thought of as a separate "piece" of my system to be managed by the ops team. The ops team manages my service, which contains Postgres as a component. Same as if I had built a VM that contained both my app and Postgres. In short, containers (and especially the higher-level abstraction of container "services" or "pods") allow you to build and plan your service as a set of separate black-boxes, rather than owning their build processes; but then allow you to run your service as a unit and upgrade it as a unit, rather than each build-time component resulting in a separate runtime consideration. --- And yes, all this could be accomplished just as well with VMs. There's nothing specifically about containers that makes them able to do things that VMs cannot. It's just how the two ecosystems have evolved. If you: • built an equivalent of Docker's "public registry" and "private URL-accessible registries" for VMs—maybe by generalizing AWS's AMI registry • ensured that all common VM software could start VMs using a spec that pointed at an AMI URN/URL, downloading and caching AMIs from wherever in the process • encouraged a public stance toward having a Vagrantfile in your project root that will—with no configuration—build a public-usable virtual appliance out of your project • added automatic-build-from-Vagrantfile support to your public AMI registry • encouraged an 'immutable infrastructure' approach to the resulting Vagrant VMs, such that they'd put all their state into hypervisor-provided stateful mounts (of SAN disks or NFS or what-have-you) • enforced a common semantics for services/pods of VMs in hypervisors ...then you could treat VMs the way you treat containers, using the VM-management client tooling to push out a version-upgrade of your service, that would replace various VMs with VMs based on a newer AMI—without losing any state. It's all a matter of changing the culture and idioms. That doesn't mean it's easy.
- korzun 9y ago> Gone are the days of building a VM from scratch, That happened about five years ago, without any help from Docker. Every single Docker 'fan' that I came across was really out of touch when it came to non-Docker OS architecture. Ironicly enough, they almost often acted as a domain expert.
- vacri 9y agoYou might want to look at the concept of a Standard Operating Environment. The benefits you describe are not docker benefits, but SOE benefits. Docker image layers perform exactly the same function as SOEs for your VMs. [X] base tools -> + python -> + ruby|php|whatever -> + myapp... It doesn't matter whether X is 'docker' or 'vm image', the concept is the same.
- berdario 9y ago> Gone are the days of building a VM from scratch, following instructions for a previous version of the OS, installing 10 dependencies, installing the app, cursing when it fails half way through, installing another missing dependency, installing the app again, bouncing the server, and then having it all fall apart again because the app isn't registered to run as a service at startup (because you missed that step). Weird, You wouldn't have to deal with Nginx and services for local development What you describe doesn't sound like local development... But rather acceptance/manual integration or product/feature review/approval But in places with good automation there's tools or a pipeline that automatically spins up instances (potentially containers) with your branch/feature and automatically link them to other services and exposes them From this point of view, docker can be useful for deployments... But it's mostly useless for development, since it doesn't help with keeping prod/Dev environments identical to each other
- koolba 9y ago> What you describe doesn't sound like local development... But rather acceptance/manual integration or product/feature review/approval > ... > But it's mostly useless for development, since it doesn't help with keeping prod/Dev environments identical to each other If you're working on a feature that integrates with LDAP, you need an LDAP accessible locally. Docker lets you spin one up near instantly. The alternative I'm describing is to install the LDAP server locally or in a VM. Both are definitely options, but they're significantly more intrusive or involve (or both). Ditto for a Postgres DB, a Redis server, or any other external resource needed by your app. It's not just for integration tests. You need them available to develop against and Docker provides a consistent way for everybody to spin up those resources quickly.