4 ms·
Doesn't statically compiling programs solve the deployment issue better? I mean, as far as I can tell Docker only exists because it's impossible to link to glib
by IshKebab 10y ago
Doesn't statically compiling programs solve the deployment issue better? I mean, as far as I can tell Docker only exists because it's impossible to link to glibc statically, so it's virtually impossible to make Linux binaries that are even vaguely portable.
Except now Go and Rust make it very easy to compile static Linux binaries that don't depend on glibc, and even cross-compile them easily.
Hell I think it's actually not even that hard to do with C/C++: https://www.musl-libc.org/how.html https://www.musl-libc.org/how.html
If I have a binary built by Go, what problems does Docker solve that just copying that binary to a normal machine doesn't?
- themartorana 10y agoYes yes yes. We're nearly 100% Go on the backend and deployment is a breeze. We don't use Docker because it wouldn't give us anything beyond more things to configure. Our CI deploys binaries to S3 and the rest is just as easy.
- jalfresi 10y agoHave to admit, as a fellow Go dev, with single binary static compiles, I don't really GET why I need docker... all it seems to offer is an increased workload and complicated build proc
- phamilton 10y agoIsolation is a strong argument. You don't want one process to starve another. You can get isolation via one-host-per-service or you can get it using cgroups. Docker sort of gives you both, without the waste of one-per-host and with a manageable set of tooling around cgroups.
- CrLf 10y agosystemd runs services in their own cgroup by default and gives you control over the resources alloted to those cgroups.
- invaliduser 10y agoIn my humble case, Docker solves the problems I have to manage the systems on which my application runs (and that's mainly it). A single dockerfile of 20-30 lines describes a whole system (operating system, versions, packages, libraries, etc), and cherry on the cake, I can version it in my git repository. This is not revolutionary in itself, but having the creation and deployment of a server being 100% replicable (+ fast and easy!) on dev, preproduction, and production environments, plus it's managed with my usual versionning tool, that is something I appreciate very much. Sure, there are other tools to do the same, but docker does the job just fine.
- jacques_chester 10y ago> having the creation and deployment of a server being 100% replicable The problem of ensuring that upstream dependencies can be reproducibly installed and/or built is, of course, left as an exercise for the reader.
- ownagefool 10y agoYou don't really, but tools like kubernetes, which are really useful if you're deploying a number of heterogeneous apps, expect a container format as they aim at a market wider than just golang. The overhead of putting the service inside docker and following 12 factor is minimal and largely worth it, but if you're only running a single go binary, you could legitimatly go other ways. Something like kubernetes also lets you abstract away the lock-in of your cloud infrastructure, so whilst it adds another layer and a bit of complexity, it again is arguably worth the effort if you're worried about needing to migrate away from your current target for some reason in the future. As a framework it abstracts apps from infrastructure quite well. It's super easy for me to replace my log shipping container in kubernetes and have most things continue to work, as all the apps have a uniform interface. Nobodies saying you can't build these things without kubernetes, but it definitely gives me more of the things than configuation managment systems currently do. Personally, I'd rather aim at the framework than handles more of what I need it to do. Finally, bootstrapping a kubernetes cluster is actually quite trivial and you can get one off the shelf in GKE, so I'm not really sure why I'd personally want to go another route.
- oldmanjay 10y agoNamespaced filesystem and networking, just for one. you seem very eager to dismiss a technology you only barely understand.
- IshKebab 10y agoNamespaced filesystem shouldn't even be a special requirement - your program should use relative or at least configurable paths. I mean, directories are namespaced filesystems. What networking problems does Docker solve?
- alexandre_m 10y agoNamespaced FS as in chroot. Your program don't see what else is running on the system. Also means that it removes possible conflicts for shared libraries and other system-wide dependencies. This kind of isolation is not only good for app bundling as a developer, but even more important as an operator in a multi-tenant scenario. You throw in containers and they don't step on each other toes. Plus, system stay clean and it's easy to move things around. Network namespace as in linux network namespace (http://man7.org/linux/man-pages/man8/ip-netns.8.html http://man7.org/linux/man-pages/man8/ip-netns.8.html). Each container has it's own IP stack. Containers provide proper abstractions so you can then assemble all of this, pretty much like you use pipes on a unix shell.
- alexandre_m 10y agoBinaries are one thing, but there are the other abstractions that containers bring in regard to networking and storage. You expose what are the network APIs of your apps (e.g open ports), filesystem mounts, variables (12 factors), etc. Your application becomes a block that you can assemble for a particular deployment; add some environment variables, connect a volume with a particular driver to a different storage backend, connect with an overlay to be able to talk to other containers privately across different servers or even DCs, etc. It's really all about layers of abstraction for operating an application and deploying it to different environments. With the latest container orchestration tools, you can have a catalog of application templates defined simply in Yaml and it's very easy to make it run anywhere. Add some autoscaling and rolling upgrades and it becomes magic for ops (not perfect yet, but checkout latest Kubernetes to see new advancements in this space). With the proper tools and processes, this removes a lot of complexity.
- Svenskunganka 10y ago> add some environment variables, connect a volume with a particular driver to a different storage backend, connect with an overlay to be able to talk to other containers privately across different servers or even DCs, etc. But environment variables already exists without docker. Volumes already exists, aka partitions. "Overlay network" already exists, aka unix sockets or plain TCP/UDP/etc over the loopback interface. I'm not trying to be a dick here, it's just that the points you brought up doesn't really bring anything new to the table. How is this different from just having a couple bare-metal or virtual machines behind a proxy? There are some aspects to containerization that are very feasible, but only at certain scales and the points you brought up makes me question whether you perhaps might be over-engineering things a bit.
- alexandre_m 10y agoIt's about the automation of these things. You now have generic interfaces (Dockerfile, docker-compose, Kubernetes/Rancher templates, etc.) to define your app and how to tie it together with the infrastructure. Having these declarative definitions make it easy to link your app with different SDN or SDS solutions. For example, RexRay for the storage backend abstraction of your container: http://rexray.readthedocs.io/en/stable/ http://rexray.readthedocs.io/en/stable/ You can have the same app connected to either ScaleIO in your enterprise or EBS as storage. We are closer than ever to true hybrid cloud apps and it's now much more easier to streamline the development process from your workstation to production. I think it's pretty exciting :)