9 ms·
Ask HN: What is the actual purpose of Docker?
I'm hearing about Docker every other day, but when I look into it, I don't understand the purpose of it.
I run many websites/applications that need isolation from each other on a single server, but I just use the pretty-standard OpenVZ containers to deal with that (yes I know I could use KVM servers instead, but I haven't ran into any issues with VZ so far).
What's the difference between Docker and normal virtualization technology (OpenVZ/KVM)? Are there any good examples of when and where to use Docker over something like OpenVZ?
- jacques_chester 11y agoDocker uses the same kernel primitives as other container systems. But it tied together cgroups, namespaces and stackable filesystems into a simple cohesive model. Add in image registries and a decent CLI and the developer ergonomics are outstanding. Technologies only attract buzz when they're accessible to mainstream developers on a mainstream platform. The web didn't matter until it was on Windows. Virtualization was irrelevant until it reached x86, containerization was irrelevant until it reached Linux. Disclaimer: I work for a company, Pivotal, which has a more-than-passing interest in containers. I did a presentation on the history which you might find interesting: http://livestre.am/54NLn http://livestre.am/54NLn
- bosse 11y agoAs an ops guy, I would also mention the benefits of the Dockerfile and docker-compose.yml, which could be clear sources for information to how the system is built, and which in most circumstances would build the same system in dev as in prod. By changing a docker tag in the configuration management, I can roll out a new version quite conveniently to staging and eventually to production. The potential minimalism of a container is also an important concept to mention, with fast startup-times and less services that could potentially be vulnerable.
- patsplat 11y agoAgreed. Application runtime dependencies are a common source of communication breakdowns between development and infrastructure teams. Making the application container a maintained build file on the project improves this communication. docker provides: * a standard format for building container images (the Dockerfile) * a series of optimizations for working with images and containers (immutable architecture etc). * a community of pre-built images * a marketplace of hosting providers All at the cost of linux only, which is ok for many shops.
- spaceisballer 11y agoI know you have some other questions that I am not qualified to answer, but I recalled seeing a similar question asked not that long ago. https://news.ycombinator.com/item?id=9805056 https://news.ycombinator.com/item?id=9805056
- atsaloli 11y agoSee http://stackoverflow.com/questions/29304951/difference-between-docker-and-openvz http://stackoverflow.com/questions/29304951/difference-betwe...
- csardi 11y agoI like this presentation, as it shows what Docker really is, and also how to use Docker without Docker: https://chimeracoder.github.io/docker-without-docker/#1 https://chimeracoder.github.io/docker-without-docker/#1
- grhmc 11y agoFor me, it is the ultimate in the idea in Continuous Delivery of "build once." I can be very confident that the docker image I build in the first stage of my pipeline will operate correctly in production. This is because that identical image was used for unit tests, to integration and functional testing, to the staging environment and finally production. There is no difference than configuration. This is the core that Docker solves, and in such a way that developers can do most of the dependency wrangling for me. I don't even mind Java anymore because the CLASSPATHs can be figured out once, documented in the Dockerfile in a repeatable programatic fashion, and then ignored. In my opinion the rest of it is gravy. Nice tasty gravy, but I don't care so much about the rest at the moment. Edit: As danesparz points out, nobody has mentioned immutable architecture. This is what we do at Clarify.io. See also: https://news.ycombinator.com/item?id=9845255 https://news.ycombinator.com/item?id=9845255
- magicmu 11y agoLike OP, I've been wondering exactly what problem Docker is meant to solve -- thank you for this explanation, it makes total sense.
- hueving 11y agoThis was already done at the development shop I last worked at with VM images. Docker didn't do anything in particular to help this except for reducing the image size.
- odiroot 11y agoHow do you handle different configurations then? Especially if you need to provide N values (or structured data). Also, how do you manage your containers in production?
- omarforgotpwd 11y agoI use environment variables, which can be passed in as arguments when you start the container. In cases where the configuration is complicated I'll use an environment variable to tell the container which redis key / db key to load config from.
- justincormack 11y agoOpenVZ is not upstream in the kernel; the container stuff that got merged is what Docker uses. Docker has much wider adoption than OpenVZ does now.
- jdoss 11y ago> Docker has much wider adoption than OpenVZ does now. I don't think your statement is true at this point in time. OpenVZ is used by a ton of companies in the hosting industry and by large companies such as Groupon and smaller ones like TravisCI [1]. I would't make a statement that that Docker has a wider adoption than OpenVZ at this point in time. Maybe in five years, yes it may have a wider adoption than OpenVZ. OpenVZ and commercial VZ have been doing full OS containers since the early 2000s and it has the production track record to do very well in many server applications. I wouldn't hesitate to use it over Docker in production for my future projects. [1]: http://changelog.travis-ci.com/post/45177235333/builds-now-running-on-openvz http://changelog.travis-ci.com/post/45177235333/builds-now-r...
- SEJeff 11y agoAnd Docker is massively used at Groupon, so your argument isn't valid. https://engineering.groupon.com/2014/misc/dotci-and-docker/ https://engineering.groupon.com/2014/misc/dotci-and-docker/ http://www.meetup.com/Docker-Chicago/events/220936626/ http://www.meetup.com/Docker-Chicago/events/220936626/ Source: I work at 600 W Chicago, the Groupon World HQ, where they frequently host Docker meetups on the 6th floor.
- jdoss 11y agoI never said Docker wasn't used at Groupon and just because it is used in some cases, doesn't make my point any less valid. It is going to take a lot more than a few years to take over OpenVZ/Virtuozzo in market share when most of the commodity hosting industry uses it.
- SEJeff 11y agoFWIW: The two companies that contributed the most to the namespace code in the upstream Linux kernel (that Docker uses) were Parallels and Google, both of which know a lot about containers at Scale. For those that don't know, Parallels wrote virtuozzo. (from linux.git): $ git log --pretty=oneline --no-merges --author='@parallels.com' | wc -l 695 I also suspect that it won't take super long for container technologies like Docker to take over OpenVZ/Virtuozzo if not only for projects like Kubernetes, which is backed by Google, and is the basis for commercial PaaS offerings such as Openshift v3 from Redhat. Virtuozzo is great tech, but using it for a new buildout seems like a bad idea for the forseeable future. Docker is not as good, but will be soon, and is supported out of the box on every modern distribution.
- corradio 11y agoMight be interesting for you: https://medium.com/using-artificial-intelligence-to-make-technology/engineering-a-fast-feedback-infrastructure-6f6f132e5807 https://medium.com/using-artificial-intelligence-to-make-tec...
- KaiserPro 11y agodocker and openVZ aim to do the same thing. docker is a glorified chroot and cgroup wrapper. There is also a library of prebuilt docker images (think of it as a tar of a chroot) and a library of automated build instructions. The library is the most compelling part of docker. everything else is basically a question of preference. You will hear a lot about build once, deploy anywhere. whilst true in theory, your mileage will vary. what docker is currently good for: o micro-services that talk on a messaging queue o supporting a dev environment o build system hosts However if you wish to assign ip addresses to each service, docker is not really mature enough for that. Yes its possible, but not very nice. You're better off looking at KVM or vmware. There is also no easy hot migration. So there is no real solution for HA clustering of non-HA images. (once again possible, but not without lots of lifting, Vmware provides it with a couple of clicks.) Basically docker is an attempt at creating a traditional unix mainframe system (not that this was the intention) A large lump of processors and storage that is controlled by a singular CPU scheduler. However, true HA clustering isn't easy. Fleet et al force the application to deal with hardware failures, whereas Vmware and KVm handle it in the hypervisor.
- ageofwant 11y ago> docker and openVZ aim to do the same thing. docker is a process container not a system container. > docker is a glorified chroot and cgroup wrapper. that is fairly immaterial, suffice to say that the underlying linux core tech that enables docker has matured enough lately to enable a tool like docker. I built many containers and I never thought about them in terms of the underlying tech. > There is also a library of prebuilt docker images (think of it as a tar of a chroot) yes > and a library of automated build instructions more accurate to say there is a well defined SDL for defining containers. > You will hear a lot about build once, deploy anywhere. whilst true in theory, your mileage will vary. have to agree, this is oversold as most of the config lives in attached volumes and needs to be managed outside of the container. > However if you wish to assign ip addresses to each service, docker is not really mature enough for that. Yes its possible, but not very nice. You're better off looking at KVM or vmware. Have to disagree here, primarily because each service should live in each own container, docker is a process container, not a system container. Assemble a system out of several containers, don't mash it all up into one - most people don't seem to get this about docker. > There is also no easy hot migration. So there is no real solution for HA clustering of non-HA images. (once again possible, but not without lots of lifting, Vmware provides it with a couple of clicks.) None is required. Containers are ephemeral and generally don't need to be migrated, they are simply destroyed and started where needed. Requiring 'hot migration' in the docker universe generally means you are doing it wrong. Not to say that there is no place for that. As a final note, all my docker hosts are kvm vm's.
- alextgordon 11y ago1. Stateless servers. Put your code and configuration in git repos, then mount them as volumes in your docker container. The absolute star feature of docker is being able to mount a file from the host to the container. You can tear down the host server, then recreate it with not much more than a `git clone` and `docker run`. 2. Precise test environment. I can mirror my entire production environment onto my laptop. No internet connection required! You can be on a train, on a plane, on the beach, in a log cabin in the woods, and have a complete testing environment available. Docker is not a security technology. You still need to run each service on a separate host kernel, if you want them to be properly isolated.
- davexunit 11y ago>The absolute star feature of docker is being able to mount a file from the host to the container. This is a simple bind-mount and isn't special at all. mount("/foo", "/container/foo", "none", MS_BIND); Also, virtual machines have had things like 9p that allow the same thing.
- alextgordon 11y agoI don't think there is enough RAM in my laptop to run five VMs simultaneously :)
- davexunit 11y agoYeah, containers are much slimmer.
- mbrock 11y agoI don't know much about virtualization technology, but Docker is nice for me because it's an accessible, well-known, and rather easy way to make applications easy and straightforward to run. Where I've worked in the past, setting up a new development or production environment has been difficult and relied on half-documented steps, semi-maintained shell scripts, and so on. With a simple setup of a Dockerfile and a Makefile, projects can be booted by installing one program (Docker) and running "make". You could do that with other tools as well, but Docker, and even moreso the emerging "standards" for container specification, seems like an excellent starting point.
- dschiptsov 11y agoTo create a buzzword to attract investors money. It is professional brand management at work.
- theneb 11y agoI find docker is quite good for integration tests where you need to test against a third party bit of software. Lots of images exist in the hub for this.
- mariocesar 11y agoThe most common pro is "Build once deploy everywhere" even is possible, I always feel pushing a 500 MB tar image to the production servers is more an annoyance than being helpful; Yes, You can setup your own registry but maintaining the service, securing, adding user permissions and maybe use a proper backend like S3 is an extra annoying layer and another component that could fail. If the docker tool will have something like `docker serve` and start his own local registry will be more than great. For this case when I switch to Go was a great solution, building the binary is everything you need. About docker being helpful for development, definitively yes, I switch to postgres, elasticsearch and redis containers instead of installing them on my computer, is easy to flush and restart and having different versions of services is also more manageable
- danesparza 11y agoI'm stunned that nobody has brought up the idea of 'immutable architecture' -- the idea that you create an image and deploy it, and then there is no change of state after it's deployed. If you want a change to that environment, you create a new image and deploy that instead. Docker gives you the ability to version your architecture and 'roll back' to a previous version of a container.
- hueving 11y agoNobody is mentioning it because VM's already did this for more than a decade.
- hosh 11y agoThis isn't true. The way VMs handle this doesn't carry the same semantics as the way you can with Docker. There's a finer-grain composability with Docker that is much more awkward with VMs. Docker may not be as great as a virtualization tool as VMs -- security concerns, complexity, etc. -- but it is a much better package management tool.
- grhmc 11y agoYep, I haven't specifically mentioned it, but check my top level reply to this thread. Clarify.io practices immutable architecture down to a T, and benefit greatly from it.
- crdoconnor 11y agoThis means that you have to roll out a (potentially huge) new blob each time you want to make even small config changes. You get most of the benefits of immutable builds anyhow by having scripts which can reliably set up servers from scratch on the fly.
- IanCal 11y agoThis is where the layers come in useful, pulling a small change should only require pulling a small new layer.
- 11y ago
- akshaykarle 11y agoDocker is mainly an app packaging mechanism of sorts. Just like you would build a jars, wars or rpms, etc. you create docker images for your applications. The advantage you get is that you can package all your dependencies in the container thereby making your application independent and using the tools provided by docker in combination with swarm, compose, etc. it makes deployment of your apps and scaling easier. OpenVZ, LXC, solaris zones and bsd jails on the other hand or mainly run complete OS and the focus is quite different from packaging your applications and deployments. You can also have a look at this blog which explains the differences more in detail: http://blog.risingstack.com/operating-system-containers-vs-application-containers/ http://blog.risingstack.com/operating-system-containers-vs-a...
- hmans 11y agoDocker is the industry-accepted standard to run web applications as root.
- davexunit 11y agoIt's unfortunate that Docker still doesn't use user namespaces.
- justincormack 11y agoNo, they are new and have had many security issues. Just run your containers not as root, you can use capabilities if you like.
- davexunit 11y agoBut certain namespaces cannot be created without CAP_SYS_ADMIN. Sure, you can drop privileges later, but a privilege escalation exploit in the container gives the attacker root access outside of that container, too. Sure, user namespaces have had issues, but they seem a hell of a lot safer than no isolation at all. Furthermore, user namespaces allow unprivileged users to create containers, too, which is particularly exciting.
- zwischenzug 11y agoSome key points: - Docker is nothing new - it's a packaging of pre-existing technologies (cgroups, namespaces, AUFS) into a single place - Docker has traction, ecosystem, community and support from big vendors - Docker is _very_ fast and lightweight compared to VMs in terms of provisioning, memory usage, cpu usage and disk space - Docker abstracts applications, not machines, which is good enough for many purposes Some of these make a big difference in some contexts. I went to a talk where someone argued that Docker was 'just a packaging tool'. A sound argument, but packaging is a big deal! Another common saw is "I can do this with a VM". Well, yes you can, but try spinning up 100 vms in a minute and see how your MacBook Air performs.
- 3pt14159 11y agoWhat is important to note is that the ideal use case for Docker is not actually speed - it's about quickly responding to increased load. If you need to vary the number of, say, web servers from 5 to 100 over the day, then Docker is good because you can start them up very quickly. The down side about docker is that it takes longer to set up your docker in the first place, it is harder to keep secure, and it runs slower than a traditionally deployed application, but compared to VM deployed applications the performance is usually better.
- arenaninja 11y agoDocker is indeed fast and lightweight. It's amazing how much CPU power is freed up from not running a full on VM in VirtualBox. That said, I'm wary of running it in production
- zwischenzug 11y agoWhy? Security?
- arenaninja 11y agoYep. I don't understand the security implications well enough to guard against them. As much as I like cutting edge tech I prefer to not actually cut myself with it!
- Kiro 11y agoFor me I don't understand the purpose at all. I have a few node.js and PHP services. Why do I need isolation and have them in containers? If I want an identical environment when developing I can use Vagrant.
- SEJeff 11y agoFYI: Vagrant can use docker, rendering your argument invalid :) http://docs.vagrantup.com/v2/provisioning/docker.html http://docs.vagrantup.com/v2/provisioning/docker.html Docker is about running isolated environments in reproducible ways. I get a container working just so on my desktop, ship it to an internal registry, where it gets pulled to run on dev and qa. It works identically to how it works on my desktop, then I ship it to production. One image that works the same on all environments. That is what docker was for, developer productivity.
- theknarf 11y agoDocker is a way to create immutable infrastructure, which is a key component to a) have software working the same in test and prod. (hint DevOps.) and b) creating servers which can scale both vertically and horizontally. I think thats the best way I can summarise what Docker _is_.
- jtwebman 11y agoIt's a tool to make over engineering every project even easier! All joking aside it is a good tool for some teams to make sure the same exact code is running in production that was tested. I don't think it is for everyone and can make things much more complicated than they need to be. I also don't think everything needs to be in a docker.
- pjc50 11y agoThe description on HN the other day of Docker as a souped-up static linking system is the most interesting one.
- deleted 11y ago[deleted]
- bfirsh 11y agoThis explains the difference between Docker and normal virtualization technology: https://www.docker.com/whatisdocker https://www.docker.com/whatisdocker
- tinco 11y ago> What's the difference between Docker and normal virtualization technology (OpenVZ/KVM)? Are there any good examples of when and where to use Docker over something like OpenVZ? Docker is exactly like OpenVZ. It became popular because they really emphasize their OpenVZ Application Templates feature, and made it much more user friendly. So users of Docker, instead of following this guide: https://openvz.org/Application_Templates https://openvz.org/Application_Templates They write a Dockerfile, which in a simple case might be: FROM nginx COPY index.html /usr/share/nginx/html So no fuzzing with finding a VE somewhere, downloading it customizing it, and then installing stuff manually, stopping the container and tarring it, Docker does that all for you when you run `docker build`. Then you can push your nice website container to the public registry, ssh to your machine and pull it from the registry. Of course you can have your own private registry (we do) so you can have proprietary docker containers that run your apps/sites. From my perspective, the answer to your question would be: Always prefer Docker over OpenVZ, they are the same technology but Docker is easier to use. But I've never really invested in OpenVZ so maybe there's some feature that Docker doesn't have.
- segmondy 11y agoDocker and OpenVZ are not the same. Docker is single application focus. OpenVZ provides the entire OS in a container. OpenVZ has support for live migration.
- klibertp 11y ago> OpenVZ provides the entire OS in a container. Docker does that, too. Actually, I'm running docker containers as a fast and easy replacement for VirtualBox VMs.
- unclesaamm 11y agoPerhaps you could do this if you're on Linux, and booting into separate OS's that run off the Linux kernel. Or if you're using boot2docker. However, in neither case does Docker itself provide the kernel in the container.
- digital-rubber 11y agoThere is no real purpose. Just a small group of people re-inventing something that isn't new nor did need re-inventing. But they add little features to claim their right of existence.
- hueving 11y agoIt serves as an amazing excuse to re-invent the wheel at your own workplace. It's a hot technology, and if you're not using it, it's because you're inept. Rip all of the stable things out that everyone knew how to use and slap containers in there! If it's not working, it's because your not using enough containers. No security patching story at your workplace? No problem, containers don't have one either! If someone has shipped a container that embedded a vulnerable library, you better hope you can get a hold of them for a rebuild or you have to pull apart the image yourself. It's the static linking of the 21st century!
- jordigh 11y agoI want to downvote the first paragraph but upvote the second one. Doesn't Docker also help cause problems like ssh private key reuse? I am sure that there are mitigations, but it's sad to have ways to prevent some activity that the software makes easy to do.
- davexunit 11y ago>I want to downvote the first paragraph but upvote the second one. I had the very same feeling. Containers are very useful, but the Docker suite of tools just don't have a very good security story.
- xaduha 11y agoSomeone (Darren Shepherd?) compared Docker to Ajax. It's not a technological breakthrough, it's another kind of breakthrough. I think it was here [1], but deleted now. [1] http://ibuildthecloud.tumblr.com/post/63895248725/docker-is-lxcs-ajax http://ibuildthecloud.tumblr.com/post/63895248725/docker-is-...
- shawnee_ 11y agoDocker is a cute little tool that gives people who aren't that great at Linux the illusion that they know what they're doing. Throw in the use of some "Container" semantics and people become convinced it's that easy (and secure) to abstract away the containers from the kernel. But it's not, at least in my experience; not to mention that as of now, anything running Docker in production (probably a bad idea) is wide open to the OpenSSL security flaw in versions of 1.0.1 and 1.0.2, despite the knowledge of this issue being out there for at least a few days. Docker's currently "open" issue on github: https://github.com/docker/compose/issues/1601 https://github.com/docker/compose/issues/1601 Other references: https://mta.openssl.org/pipermail/openssl-announce/2015-July/000037.html https://mta.openssl.org/pipermail/openssl-announce/2015-July... http://blog.valbonne-consulting.com/2015/04/14/as-a-goat-im-skeptical-of-dockers-hype/ http://blog.valbonne-consulting.com/2015/04/14/as-a-goat-im-...
- javajosh 11y ago>Docker is a cute little tool that gives people who aren't that great at Linux the illusion that they know what they're doing. Well, that's what I personally hoped. Then you run into problems, distro specific problems, and find yourself unable to deal with it without actually becoming great at linux under a deadline. Docker can actually introduce tremendous complexity at both the Linux and application level because you have to understand how an image was prepared in order to use it, configure it, etc. (Of course, a big part of the problem is that there's no way that I know of to interactively examine the filesystem of an image without actually running the image, and accessing the FS from the tools that the image itself runs. This has to be some sort of enormous oversight either on my part or on Docker's).
- yebyen 11y agoI'm sure this is not the answer you are looking for, but you can 'docker export' a container to a tar file and examine your image file that way. (1) You're exporting a container, not an image, so if you wanted to export your image, deploy it to a container first. Run echo or some other noop if you need to. (2) This is similar to how git operates. You wouldn't want to examine your git commits interactively (assuming that means the ability to change them in place) well, if you did, git has --amend, but no such thing exists in Docker. An image with a given id is supposed to be permanent and unchanging, containers change and can be re-committed, but images don't change. They just have children. It can get hairy when you reach the image layer limit, because using up the last allowed image layer means you can't deploy to a container anymore. So, how do you export the image? 'docker save' -- but 'docker save' exports the image and all of its parent layers separately. (you need to flatten it, for example?) I once wrote this horrible script[1] whose only purpose was unrolling this mess, since the latest image had the important state that I wanted in it, but I needed the whole image -- so, untar them all in reverse order and then you have the latest everything in a single directory that represents your image filesystem. The horror of this script leads me to believe this is an oversight as well, but a wise docker guru probably once said "your first mistake was keeping any state in your container at all." [1]: https://raw.githubusercontent.com/yebyen/urbinit/del/doit.sh https://raw.githubusercontent.com/yebyen/urbinit/del/doit.sh
- hosh 11y agoYou're coming at this from the wrong direction, namely virtualization. What differentiates Docker is not virtualization, so much as package management. Docker is a package management tool that happens to allow you to execute the content of the package with some sort of isolation. Further, when you look at it from that angle, you start seeing the flaws with it, as well as it's potential. It's no accident that Rocket and the Open Container Project are arising to standardize the container format. Other, less-well-known efforts include being able to distribute the container format themselves in a p2p distribution system, such as IPFS.
- pekk 11y agoSomehow this wasn't well explained, leading to a really persistent misunderstanding that comes up any time Docker is mentioned; you can see in this very thread someone claiming to be an expert with Linux and saying that Docker is no good because it doesn't sufficiently abstract away from the kernel, as if that were its purpose. There is always someone on hand to claim that Docker is nothing more than cgroups, again, as if the packaging part of this didn't even exist.
- hosh 11y agoFair enough! I ran through the same thing too. I used to work for Opscode. I joined them because I like the idea of "infrastructure-as-code." I remember when Docker came around, I was scratching my head. There was a part of me that thought it has something, and another part that was thinking, why would anyone want to use this? Wouldn't this set us back to the time when infrastructure is not code? I couldn't put my finger on it. And what's really funny is that the "container" metaphor explains this well -- and I had spent time reading up on the history of physical, intermodal containers and how they changed our global economy to boot. The primary point of intermodal containers isn't that it isolates goods from one merchant from another; it is that there is a standard size for containers that can be stacked in predictable ways, and moved from ship to train to truck quickly and efficiently. You are no longer loading and unloading pallets and individual goods; you are moving containers around. Package management. A lot of logistics companies at the time didn't get this either. Most of the literature out there explains Docker as virtualization, or some confused mish-mash of "lightweight virtualization", or "being able to the move containers from one machine to the other." They pretty much circle around the central point of package management without nailing that jelly to the wall.
- sudioStudio64 11y agoI think the main thing is to provide an abstraction for applications so that they aren't tightly coupled to the operating system of the server that's hosting them. That's a big deal. Some people have mentioned security...patching in particular. Containers won't help if you don't have patching down. At the very least it lets you patch in the lab and easily promote the entire application into production. I think that the security arguments are a canard. By making it easier and faster to deploy you should be able to patch app dependencies as well. I, for one, would automate the download and install of the latest version of all libs in a container as part of the app build process. Hell, build them all from source. IT departments need to be able to easily move applications around instead of the crazy build docs that have been thrown over the wall for years.
- programminggeek 11y agoIt exists to create jobs in devops.
- lgunsch 11y agoSimply put, Docker is operating system virtualization: https://en.wikipedia.org/wiki/Operating-system-level_virtualization https://en.wikipedia.org/wiki/Operating-system-level_virtual... Edit: formatting.
- johnminter 11y agoI think one useful purpose was described by Prof. Mine Cetinkaya-Rundel of Duke at the recent UseR conference. She teaches an introductory statistics class for non-majors. Docker lets her spin up individual virtual machines for each student with all the packages they need for the class without all the sys-admin headaches of getting all the software on everybody's systems. You can see her slides and evaluation of the alternatives here: https://github.com/mine-cetinkaya-rundel/useR-2015/blob/master/r_studio_docker.pdf https://github.com/mine-cetinkaya-rundel/useR-2015/blob/mast...
- tobbyb 11y agoOpenVZ or LXC give you OS containers like KVM or VMWare gives your Virtual machines. Unlike OpenVZ, LXC does not need a custom kernel, and is supported in the mainline Linux kernel paving the way for widespread adoption. Docker took the LXC OS container template as a base, modified the container OS init to run a single app, builds the OS file system with layers of aufs, overlayfs, and disables storage persistence. And this is the app container. This is an opinionated use case of containers that adds significant complexity, more a way to deploy app instances in a PAAS centric scenario. A lot of confusion around containers is because of the absence of informed discussion on the merits or demerits of this approach and the understanding that you have easy to use OS containers like LXC that are perfectly usable by end users like VMs are, and then app containers that are doing a few more things on top of this. You don't need to adopt Docker to get the benefits of containers, you adopt Docker to get the benefits of docker and often this distinction is not made. A lot of users whose first introduction to containers is Docker tend to conflate Docker to containers, and thanks to some 'inaccurate' messaging from the Docker ecosystem think LXC is 'low level' or 'difficult' to use, Why would anyone try LXC if they think it's low level or difficult to use? But those who do will be pleasantly surprised how simple and straightforward it is. For those who want to understand containers, without too much fuss, we have tried to provide a short overview in a single page in the link below. https://www.flockport.com/containers-minus-the-hype https://www.flockport.com/containers-minus-the-hype Disclosure - I run flockport.com that provides an app store based on LXC containers and tons of tutorials and guides on containers, that can hopefully promote more informed discussion.
- GeertJohan 11y agoDocker does not use LXC as default execution environment anymore. They created their own, called libcontainer¹. But with the new opencontainers movement, the package has been moved to runc². [1] https://github.com/docker/libcontainer https://github.com/docker/libcontainer [2] https://github.com/opencontainers/runc https://github.com/opencontainers/runc
- tobbyb 11y agoThat's why I used the word took, Docker used LXC as a base till version 0.9, untill it got enough traction, at which point it basically recreated LXC with libcontainer. But that was not the point. The point is you have always had perfectly usable end user containers from the LXC project even before Docker. Then a VC funded company Docker bases itself on LXC and markets itself aggressively and suddenly a lot of users think LXC is 'low level' or 'difficult to use'? This messaging is coming from the Docker ecosystem and the result is the user confusion we see on most container threads here. Informed discussion means people know what OS containers are, what value they deliver, and what Docker adds on top of OS containers so there is less confusion and FUD, and users can make informed decisions without a monoculture being pushed by aggressive marketing. But that discussion cannot happen if you are in a hurry to 'own' the container story and cannot acknowledge clearly alternatives exists and what value you are adding exactly on top. I see people struggling with single app containers, layers and lack of storage persistence when they are simply looking to run a container as a lightweight VM. The 'open container movement' is yet one more attempt to 'own' the container technology and perpetuate the conflation of Docker to containers. How can a 'open container movement' exclude the LXC project that is responsible for the development of much of the container technology available today. It should ideally be called 'Open App Container' because there is a huge difference between app containers and OS containers. OS containers provide capabilities and deployment flexibility that app containers simply cannot give because they are a restrictive use case of OS containers. Containers technology as a whole cannot be reduced to a single PAAS centric use case.
- somberi 11y agoA meta critique after reading 139 comments: I too had the same question as the parent and from the ensuing conversations, I assume that either Docker is so thin-layered (not in a bad way) that it is open to so many interpretations or it is so thin-layered (in a trivial way), that one does not need to get all worked up adopting it if one is comfortable in using other VM options out there (like OpenVZ for example).
- droidztix 11y agoreading while eating popcorn ( ͡° ͜ʖ ͡°)
- tfn 11y agoI went ahead and blogged an answer here: http://blog.tfnico.com/2015/07/the-sweet-spot-of-docker.html http://blog.tfnico.com/2015/07/the-sweet-spot-of-docker.html TL;DR: It's better for deploying applications and running them than using home-made scripts.
- kolyshkin 11y ago[Disclaimer: I am the guy who was running OpenVZ since the very beginning, and if you hate OpenVZ name/logo, I am the one to blame. Also, take everything I say with a grain of salt -- although I know, use, like and develop for Docker, my expertise is mostly within OpenVZ domain, and my point of view is skewed towards OpenVZ] Technologically, both OpenVZ and Docker are similar, i.e. they are containers -- isolated userspace instances, relying on Linux Kernel features such as namespaces. [Shameless plug: most of namespaces functionality is there because of OpenVZ engineers work on upstreaming]. Both Docker and OpenVZ has tools to set up and run containers. This is there the similarities end. The differences are: 1 system containers vs application containers OpenVZ containers are very much like VMs, except for the fact they are not VMs but containers, i.e. all containers on a host are running on top of one single kernel. Each OpenVZ container has everything (init, sshd, syslogd etc.) except the kernel (which is shared). Docker containers are application containers, meaning Docker only runs a single app inside (i.e. a web server, a SQL server etc). 2 Custom kernel vs vanilla kernel OpenVZ currently comes with its own kernel. 10 years ago there were very few container features in the upstream kernel, so OpenVZ has to provide their own kernel, patched for containers support. That support includes namespaces, resource management mechanisms (CPU scheduler, I/O scheduler, User Beancounters, two-level disk quota etc), virtualization of /proc and /sys, and live migration. Over ten years of work of OpenVZ kernel devs and other interesting parties (such as Google and IBM) a lot of this functionality is now available in the upstream Linux kernel. That opened a way for other container orchestration tools to exist -- including Docker, LXC, LXD, CoreOS etc. While there are many small things missing, the last big thing -- checkpointing and live migration -- was also recently implemented in upstream, see CRIU project (a subproject of OpenVZ, so another shameless plug -- it is OpenVZ who brought live migration to Docker). Still, OpenVZ comes with its own custom kernel, partly due to retain backward compatibility, partly due to some features still missing from the upstream kernel. Nowadays that kernel is optional but still highly recommended. Docker, on the other side, runs on top of a recent upstream kernel, i.e. it does not need a custom kernel. 3 Scope Docker has a broader scope than that of OpenVZ. OpenVZ just provides you with a way to run secure, isolated containers, manage those, tinker with resources, live migrate, snapshot, etc. But most of OpenVZ stuff is in the kernel. Docker has some other things in store, such as Docker Hub -- a global repository of Docker images, Docker Swarm -- a clustering mechanism to work with a pool of Docker servers, etc. 4 Commercial stuff OpenVZ is a base for commercial solution called Virtuozzo, which is not available for free but adds some more features, such as cluster filesystem for containers, rebootless kernel upgrades, more/better tools, better containers density etc. With Docker there's no such thing. I am not saying it's good or bad, just stating the difference. This is probably it. Now, it's not that OpenVZ and Docker are opposed to each other, in fact we work together on a few things: 1. OpenVZ developers are authors of CRIU, P.Haul, and CRIU integration code in Docker's libcontainer. This is the software that enables checkpoint/restore support for Docker. 2. Docker containers can run inside OpenVZ containers (https://openvz.org/Docker_inside_CT https://openvz.org/Docker_inside_CT) 3. OpenVZ devs are authors of libct, a C library to manage containers, a proposed replacement or addition to Docker's libcontainer. When using libct, you can use enhanced OpenVZ kernel for Docker containers. There's more to come, stay tuned.
- kolyshkin 11y ago[Disclaimer: I am the guy who was running OpenVZ since the very beginning, and if you hate OpenVZ name/logo, I am the one to blame. Also, take everything I say with a grain of salt -- although I know, use, like and develop for Docker, my expertise is mostly within OpenVZ domain, and my point of view is skewed towards OpenVZ] Technologically, both OpenVZ and Docker are similar, i.e. they are containers -- isolated userspace instances, relying on Linux Kernel features such as namespaces. [Shameless plug: most of namespaces functionality is there because of OpenVZ engineers work on upstreaming]. Both Docker and OpenVZ has tools to set up and run containers. This is there the similarities end. The differences are: 1 system containers vs application containers OpenVZ containers are very much like VMs, except for the fact they are not VMs but containers, i.e. all containers on a host are running on top of one single kernel. Each OpenVZ container has everything (init, sshd, syslogd etc.) except the kernel (which is shared). Docker containers are application containers, meaning Docker only runs a single app inside (i.e. a web server, a SQL server etc). 2 Custom kernel vs vanilla kernel OpenVZ currently comes with its own kernel. 10 years ago there were very few container features in the upstream kernel, so OpenVZ has to provide their own kernel, patched for containers support. That support includes namespaces, resource management mechanisms (CPU scheduler, I/O scheduler, User Beancounters, two-level disk quota etc), virtualization of /proc and /sys, and live migration. Over ten years of work of OpenVZ kernel devs and other interesting parties (such as Google and IBM) a lot of this functionality is now available in the upstream Linux kernel. That opened a way for other container orchestration tools to exist -- including Docker, LXC, LXD, CoreOS etc. While there are many small things missing, the last big thing -- checkpointing and live migration -- was also recently implemented in upstream, see CRIU project (a subproject of OpenVZ, so another shameless plug -- it is OpenVZ who brought live migration to Docker). Still, OpenVZ comes with its own custom kernel, partly due to retain backward compatibility, partly due to some features still missing from the upstream kernel. Nowadays that kernel is optional but still highly recommended. Docker, on the other side, runs on top of a recent upstream kernel, i.e. it does not need a custom kernel. 3 Scope Docker has a broader scope than that of OpenVZ. OpenVZ just provides you with a way to run secure, isolated containers, manage those, tinker with resources, live migrate, snapshot, etc. But most of OpenVZ stuff is in the kernel. Docker has some other things in store, such as Docker Hub -- a global repository of Docker images, Docker Swarm -- a clustering mechanism to work with a pool of Docker servers, etc. 4 Commercial stuff OpenVZ is a base for commercial solution called Virtuozzo, which is not available for free but adds some more features, such as cluster filesystem for containers, rebootless kernel upgrades, more/better tools, better containers density etc. With Docker there's no such thing. I am not saying it's good or bad, just stating the difference. This is probably it. Now, it's not that OpenVZ and Docker are opposed to each other, in fact we work together on a few things: 1. OpenVZ developers are authors of CRIU, P.Haul, and CRIU integration code in Docker's libcontainer. This is the software that enables checkpoint/restore support for Docker. 2. Docker containers can run inside OpenVZ containers (https://openvz.org/Docker_inside_CT https://openvz.org/Docker_inside_CT) 3. OpenVZ devs are authors of libct, a C library to manage containers, a proposed replacement or addition to Docker's libcontainer. When using libct, you can use enhanced OpenVZ kernel for Docker containers. There's more to come, stay tuned.