News for hackers. Stuff that matters.
Re:Docker in Production: A retort by carapace on Saturday November 05, 2016 @03:01PM (#12881308)
I've never used Docker, or containers, but I read about things like "Breaking changes and regressions ... a well documented problem with Docker" and "Can’t clean old images ... a well known issue" and it just seems to me like a crazy thing to try to use and depend on this thing/company. Bluntly put they seem like children.

So nevermind a retort, what I would like to see is a sane, sensible "business value" cost/benefit, pros v. cons breakdown of just what the heck you're actually gaining (and losing) using Docker vs. some other architecture/methodology. Because absent that it's all just hype and kool-aid drinking in my opinion.

What would help with the above is if people would document what they are doing with Docker that works, because either they are hurting but not realizing it, or the author of the article is just "doing it worng" and whining about it in public. What is really going on with Docker, et. al.!?

Re:Docker in Production: A retort by emeraldd on Saturday November 05, 2016 @04:15PM (#12881654)
I can tell you one place I've found them very valuable: development systems. The longer I've been in the field, the more I've learned that polluting my dev box with globally installed tools makes life painful down the road. Docker provides a nice way (especially now that they have docker exec) to spin up environments, or set's of environments with tools/stacks and not touch the host. It's lighter than a bunch of vm instances and easier to orchestrate on a small scale than most tools I've found. Docker for Mac makes that even nicer!
Re:Docker in Production: A retort by girvo on Saturday November 05, 2016 @06:52PM (#12882347)
Completely agreed. My workplace adopted Docker for local development first, before using it anywhere else. Aside from the "volume mount wiping the `node_modules` folder that was installed in the image but doesn't exist in the host on first boot" problem, it's been an absolute dream.

We had some issues with docker-compose for our use-cases, such as persistent database even when recreating every container from scratch, so I hacked on some stuff that become "dup" [0] (nee. docker-up)

Ps. it's written in Nim, which was a lot of fun!

[0] https://github.com/girvo/dup

Re:Docker in Production: A retort by notliketherest on Sunday November 06, 2016 @01:03AM (#12883619)
Assuming you're also running your db in dockrr, why didn't attaching docker volumes work for you for database persistence ?
Re:Docker in Production: A retort by girvo on Sunday November 06, 2016 @01:41AM (#12883711)
Because docker-compose had a very bad habit of destroying and rebuilding the volume-only container, unfortunately! This was of course back when running Docker on macOS was somewhat painful, so mounting the DB data directory directly as a volume into your host would nearly always fail to work successfully due to screwy permissions errors (it's quite a bit better now with Docker for Mac)

So, some dodgy code and a JSON file later, and our team uses the `dup` CLI to run everything with exactly zero hitches thus-far, and we've been using (across it's two incarnations) for... 18 months now?

Re:Docker in Production: A retort by roblabla on Saturday November 05, 2016 @08:16PM (#12882674)
I find using nix as a package manager to be a better solution. Write a nixfile that have all the tools you need for a script, and you're fixed.

Docker is a slow, blunt tool for just containerizing dependencies IMO.

Re:Docker in Production: A retort by swsieber on Sunday November 06, 2016 @01:34AM (#12883693)
A slow, blunt, cross-platform tool. So while I agree, I don't think nix makes a good replacement for docker.
Re:Docker in Production: A retort by Drdrdrq on Sunday November 06, 2016 @01:29AM (#12883854)
Cross-distribution, to be precise. You can't run amd64 image on RPi for instance.
Re:Docker in Production: A retort by justincormack on Sunday November 06, 2016 @05:08AM (#12884382)
Cross platform. Runs on Linux, Windows, and the Solaris port is being merged. There was a FreeBSD port but it was alas not upstreamed and needs some work.

No it does not change processor architectures for you.

Re:Docker in Production: A retort by sktrdie on Saturday November 05, 2016 @08:13PM (#12882657)
It's great for development if it wasn't 4 to 5 times slower on Mac: https://www.reddit.com/r/docker/comments/59u1b8/why_is_docke...
Re:Docker in Production: A retort by bdcravens on Saturday November 05, 2016 @08:34PM (#12882739)
Still feels several times faster than using an option like Vagrant. (haven't found a container that didn't cold start in less than 5 seconds; 3+ minutes for common Vagrant setup is pretty common)
Re:Docker in Production: A retort by gerdesj on Saturday November 05, 2016 @08:45PM (#12882783)
(Having read the Reddit thread for a while)

Macs don't appear to have support for containers which is what Docker is. Well that is probably bollocks because they are *BSD based and I know that FreeBSD at least has a form of containerization and I seem to recall that the whole container thing was invented on a BSD - "jails".

So Docker can't run native on iStuff. You have to run it within a Linux VM. I gave up on Googling for "apple mac jail" 8)

The reason why Docker runs slowly on Macs is because it is running under emulation within a VM.

Unfortunately, Macs are not cool enough to run Docker, so there 8)

Cheers Jon

Re:Docker in Production: A retort by anoctopus on Saturday November 05, 2016 @11:15PM (#12883290)
XNU (the macOS kernel) may have BSD origins, but it doesn't have features like cgroups and process namespacing that the Linux kernel provides and the Docker runtime relies on.
Re:Docker in Production: A retort by justincormack on Sunday November 06, 2016 @05:13AM (#12884394)
Nor does it have FreeBSD jails.
Re:Docker in Production: A retort by yawz on Saturday November 05, 2016 @07:16PM (#12882442)
Agreed! So far I've used Docker only on Dev systems. I'm still waiting to be convinced that there's sufficiently higher productivity and value to be had by introducing it to Prod.
Re:Docker in Production: A retort by manojlds on Sunday November 06, 2016 @01:36AM (#12883703)
Also for CI in the same vein.
Re:Docker in Production: A retort by jsz0 on Saturday November 05, 2016 @10:11PM (#12883068)
> seems to me like a crazy thing to try to use and depend on this thing/company

Always beware of perception bias or whatever the right term is for this. When docker was new it got tons of hype and people were talking about how great it was. Now it's no longer the hot new thing so it's just another tool many people are using quietly and successfully. It no longer warrants much positive discussion. The people using docker in production successfully don't feel compelled to write articles about it working for them.

I'd say the pros/cons of docker (or containers in general) are similar to the pros/cons of buying hand made vs. mass produced goods. The hand made goods will probably be higher quality but they take more time and skill to produce so they're more expensive. The mass produced goods will probably be lower quality but will work fine and at least offer consistent/reliable level of quality. They take less time and skill to produce so they'll also be less expensive. In the context of using Docker in production this translates to it being very good for solving 'off the shelf' types of problems quickly and reliably. It's essentially the software/systems version of an assembly line. If you don't need an assembly line then docker may be worthless or even a total waste of time. If you do need an assembly line it's the best option currently.

Re:Docker in Production: A retort by user5994461 on Sunday November 06, 2016 @06:18AM (#12884595)
You're taking the wrong assumption here.

There aren't articles about docker in production because barely anyone adopted it for major production environments [yet]. And for the few who are early adopters, there wasn't enough time to write articles.

Re:Docker in Production: A retort by ben_jones on Saturday November 05, 2016 @03:13PM (#12881362)
As someone considering using Docker for production infrastructure I'd love to hear from a docker expert what their thoughts are on the following observations:

* Docker encourages fully disposable infrastructure

* Docker containers can be more secure then traditional environments

* Docker provides for indempotent environments agnostic of hardware concerns etc

* Container management software (Kubernetes, etc.) makes Docker much more powerful/useful and is only going to get better

Specifically, I'm curious if my observations are correct, and if they are why they are correct and why are they SO much better (vs current docker alternatives including non-container based approaches).

Re:Docker in Production: A retort by user5994461 on Saturday November 05, 2016 @04:54PM (#12881841)
Author from the original article here.

>>> * Docker encourages fully disposable infrastructure => I'd consider that incorrect and/or misleading

Docker is meant to manage disposable (i.e. stateless) applications. They are expected to be killed/stopped/restarted at any time, no persistent state, no data.

An application is either disposable OR not disposable by its design, docker doesn't change that. (For instance, don't try to dockerize databases).

Docker gives you a quick, nice and easy way to package your applications with dependencies (as Docker image) AND deploy them. [This is valuable]

It's especially great for development and test environments because you can run many containers (i.e. applications) on a dev/test machine, without dependency/deployment hell. [This is very valuable]

>>> * Docker containers can be more secure then traditional environments => No. Just No.

Docker has nothing to do with security.

>>> * Docker provides for idempotent environments agnostic of hardware concerns etc

Docker gets to ignore the hardware. You do not.

You get to buy, setup and manage servers. Maintain a full environment that can run docker.

It can be an undertaking full of dangers, as told by this article and mine :D

>>> * Container management software (Kubernetes, etc.) makes Docker much more powerful/useful and is only going to get better

Docker allows to package and deploy an application. It doesn't do anything about infrastructure at all (i.e. machines, load balancers, DNS, discovery), which you still have to manage and it's a HARD problem.

The orchestration systems is supposed to help you manage all of that. As a result, it will be able to automatically kill/restart/move/add containers across a cluster and make the necessary [physical or virtual] infrastructure changes.

Container + Orchestration will be a [r]evolution to manage entire giant fleets of hosts and applications. [This will be infinitely valuable (allowing me to automate the work of 10 people, all freeing all my time to enjoy unlimited free drinks and foods)]

IMO: In the current state of affairs. Having docker without orchestration is like having cars without roads.

Re:Docker in Production: A retort by adimitrov on Saturday November 05, 2016 @08:23PM (#12882695)
> For instance, don't try to dockerize databases

Host volume mappings. Problem solved.

I've been using them for over a year, with all kinds of different databases, postgres, mysql, mongodb, in dev, ci, and production, never had a problem. It gives you a nice separation of what is and what isn't part of the application state, and makes backups a breeze.

Re:Docker in Production: A retort by fapjacks on Saturday November 05, 2016 @10:40PM (#12883163)
Right. This "don't Dockerize databases" thing is truly just bizarre. It almost in a way seems intentionally antagonistic to make Docker seem less capable than it is. After all, who wants to use something that only works for some applications? And the fact of the matter is that Docker is just a fancy way to run a process. Bind-mounted host directory volumes are one of the most fundamental features available for Docker. The truth of the matter is that Docker can be a complex beast. And what ends up happening is that often people only understand a small part of Docker features they're using. And then they complain about problems with Docker when what they really need to do is go read the documentation. Not all problems with Docker are like this, of course, but the vast majority of complaints that I see (and I see a lot of them from being part of the open source community for over three years now) come from people that don't fully understand the features of Docker they're trying to use. Getting Docker going is dead simple, and people fall into the trap of thinking that's all there is, when Docker is a damn deep technical subject.
Re:Docker in Production: A retort by mbesto on Sunday November 06, 2016 @12:57AM (#12883599)
Re:Docker in Production: A retort by closeparen on Saturday November 05, 2016 @05:26PM (#12881974)
>Having docker without orchestration is like having cars without roads.

Docker's stated purpose is to be the "shipping container" abstraction for server-side code.

Shipping containers are not much more exciting than any other kind of box (VM, jail, whatever) in isolation. Things get more interesting when every port has container-optimized cranes and there are thousands of container ships competing for your business.

Re:Docker in Production: A retort by digi_owl on Saturday November 05, 2016 @11:05PM (#12883248)
Thinking about it i seem to recall that for a while all the hoopla was about VMs that could migrate between hardware to both better utilize existing hardware resources, and allow for more uptime.

But then a while later all the buzz was containerization, with Docker as the poster boy. This, i suspect, in that rather than have the overhead of a VM and such, you could spin up a container instance over there, take it down over here, and achieve much the same result. This in particular if the content of your VM or container was talking to a storage backend anyways.

Re:Docker in Production: A retort by XorNot on Saturday November 05, 2016 @11:41PM (#12883387)
In my context it's because big data became a thing. Nobody wants to pay the virtualization IO overheads anymore.

That said, I've found myself swinging back towards preferring VMs - with docker-like infrastructure made available. The runv project (https://github.com/hyperhq/runv/) is an interesting and functional take on Docker-with-VMs since I spend way too much time wanting to do privileged things in containers.

Re:Docker in Production: A retort by scoot on Saturday November 05, 2016 @08:27PM (#12882706)
> don't try to dockerize databases

Why ever not? There no less reason to do so in a container - and all the usual benefits still apply.

Re:Docker in Production: A retort by jfoutz on Saturday November 05, 2016 @06:29PM (#12882277)
>>> * Docker encourages fully disposable infrastructure

I just want to tack on the upgrade rollback situation. A container looks a lot like a process from the host os point of view. You can bring up the new release and leave the old release running on the same machine without much difference in load. The load just shifts to the new container. With a VM approach, you kind of need both vm's for the whole upgrade window.

Depending on your orchestration, blue/green deployment is pretty straightforward.

Re:Docker in Production: A retort by user5994461 on Saturday November 05, 2016 @07:00PM (#12882388)
There can't be two containers running that listen on the same port. The rolling upgrade will need to kill the first container to start the new one.

I may suppose that you talk about [CPU] load, because you are running computations/processing applications and not webservices.

Re:Docker in Production: A retort by fapjacks on Saturday November 05, 2016 @10:44PM (#12883175)
Well, this is a problem that's been solved [0]. I've been using nginx-proxy for a couple of years now, in production, without any issues.

[0] https://github.com/jwilder/nginx-proxy

Re:Docker in Production: A retort by lobster_johnson on Sunday November 06, 2016 @01:59AM (#12883762)
Don't use static ports. Pick a random one and update the load balancer (Haproxy, Traefik, Nginx) to point to the new one. If the rollout fails, you can always roll back by pointing back the old one.

FWIW, Kubernetes solves this out of the box.

Re:Docker in Production: A retort by startling on Sunday November 06, 2016 @01:03AM (#12883785)
> No. Just No. > Docker has nothing to do with security.

Docker can totally reduce the risk of in-container services being exploited. It has sane defaults, and makes it easy to distribute other restrictions with the application (seccomp profile, apparmor settings, etc).

Re:Docker in Production: A retort by chousuke on Saturday November 05, 2016 @03:28PM (#12881442)
I'm not sure if I qualify as a docker expert, but I feel like I need to comment on these...

Firstly, I think it is correct that docker encourages disposable infrastructure, because your docker setup basically must be able to recover from the loss of a container. I think it would not be sane to expect your containers to "just keep working".

Regarding security, I don't think Docker provides much other than the illusion of better security at the moment. At least on Linux containers don't add security that you can't get with traditional services.

I suppose if you use authenticated images you can at least be sure that you're running the code you think you are, but then again package managers have had signing for ages.

You're always going to have to test your software in the environment you will be deploying it in, because driver bugs and weird interactions still exist. Docker doesn't really let you ignore the hardware

I have no opinion of kubernetes and such at the moment.

What docker does grant is an easy method of "packaging" software... Pretty much anyone can just throw everything together in a big bundle and distribute that. For certain use-cases, this can give a development team much more speed, since setting up a workable environment is much faster. There is also a nontrivial amount of software that simply does not bother with OS packaging where containers can help you deploy it in a more controlled fashion.

Re:Docker in Production: A retort by DigitalJack on Saturday November 05, 2016 @04:48PM (#12881811)
'I think it would not be sane to expect your containers to "just keep working".'

Why?

Re:Docker in Production: A retort by jodumont on Saturday November 05, 2016 @04:15PM (#12881655)
As SysAdmin, I'm going slowly but surely to Docker. You have to follow good practice such as using devicemapper which is truly not by defaults even it CoreOS.

For sure for developer it's a big thing, for SysAdmin and people thinking about the datas it's more a pain in the ass.

Anyway, no way to go back. This is the future Jack.

On the last DockerConf you could ear ADP talking about their success with Docker, but obviously their there to promote Docker. ;)

Re:Docker in Production: A retort by justincormack on Saturday November 05, 2016 @07:33PM (#12882504)
* Docker encourages fully disposable infrastructure

Absolutely. You will get the most out of it like this. You can run pets, and treat containers VMs but I don't think you will get all the advantages.

* Docker containers can be more secure then traditional environments

Out of the box you get isolation from namespaces (not being able to see the host filesystem or network), resource limits via cgroups, a default seccomp profile that restricts some system calls that could be used in exploits, and more. You can set all these defaults yourself but the majorty of people do not. So there are definit benefits.

* Docker provides for indempotent environments agnostic of hardware concerns etc

Most applications do not talk directly to hardware, the default container does not directly present hardware interfaces, yes.

* Container management software (Kubernetes, etc.) makes Docker much more powerful/useful and is only going to get better

It does help to have software to manage programs across multiple computers, for scaling and redundancy, yes.

Re:Docker in Production: A retort by empath75 on Saturday November 05, 2016 @06:34PM (#12882298)
I think old school sysadmins care way more about system stability and new school devops guys are focused on cost and the speed of the development cycle. It really doesn't matter if you architect your systems properly that docker is unstable or your services crash as long as you have effective monitoring and self healing systems.
Re:Docker in Production: A retort by gerdesj on Saturday November 05, 2016 @08:23PM (#12882693)
I'm both or rather I do things like this:

* Use modern tools to spin up a dev env * Determine how to monitor and maintain dev and deploy * Test dev env * Determine, based on dev and a deep risk assessment how prod will look * Create prod env * Determine how to monitor and maintain prod env and deploy (based on your test) * Test new prod env * Open up prod env to end users

It's not bloody rocket science - it's Engineering and the steps above hide loads of steps and feedback loops such as a safe upgrade method eg snapshot/clone VM, test, release.

If your product is important to you then you take it seriously and treat it right!

Cheers Jon

PS Did I mention documentation?