Live data from Hacker News

Ask HN: How do you use Docker in production?

news.ycombinator.com

131–140 of 157 posts

Re: Ask HN: How do you use Docker in production?

#131

I'm really interested in using Docker but I'm having trouble understanding how to manage stateful applications, like databases.

I recommend using a data volume container:

    $ docker run --name db-data -v /var/lib/db busybox true
    $ docker run --name db-server --volumes-from db-data db-image
This way you can remove the db-server container and recreated it with the same command and it will reuse the volume. See also https://docs.docker.com/userguide/dockervolumes/#creating-an...

Re: Ask HN: How do you use Docker in production?

#132

I honestly find it really depressing to see all these folks taking code and applications that would otherwise be entirely portable, and rebuilding their entire deployment and development environment around a hard dependency on Linux. If Docker becomes sufficiently popular, it's going to put HUGE nails in the coffin of portability and the vibrancy of the UNIX ecosystem.

The nails are already there, what you're describing is just tapping them in a little further.

Re: Ask HN: How do you use Docker in production?

#133
post #121

I use it to grade homeworks, no more open TCP sockets, message queues, open files, some naughties trying to delete my home.

Docker is not safe for untrusted code. If the client can get local root privileges (e.g. CVE-2014-4699, CVE-2014-4014, CVE-2014-0196, unix-privesc-check, many more) they can then escape the docker container.

But it's definitely better than running as your own user!

Re: Ask HN: How do you use Docker in production?

#134

Earlier quoted context omitted.

Well sure there can be a guarantee. `RUN apt-get install some_package= ` If you want a newer version, update the Dockerfile with the version you want.

That package could install some other dependencies, and those dependencies aren't pinned down.

That depends on how the package is specified doesn't it? You can snapshot the full chain of versions with dpkg and explicitly specify them all. It should be too hard to wrap this into something like Gemfile.lock

Re: Ask HN: How do you use Docker in production?

#135

Earlier quoted context omitted.

Well sure there can be a guarantee. `RUN apt-get install some_package= ` If you want a newer version, update the Dockerfile with the version you want.

That package could install some other dependencies, and those dependencies aren't pinned down.

[deleted]

Re: Ask HN: How do you use Docker in production?

#136
post #72
post #68

I'm considering Docker for a small side project I have where I want to deploy a Runnable Java Jar as a daemon. Getting Java paths right across different Linux distributions can be a hassle, hoping Docker will help me solve this. For that matter, getting a daemon (service) running correctly on different Linux'es is one more thorn I'd rather not have to deal with.

So you're going to add a whole virtualization layer instead of just using "java -jar myapp.jar &"? Sorry, but what? And what do you mean about getting class paths right? Somehow I don't think best practice Java development necessarily calls for virtualization.

Docker is not a virtualization layer.

Re: Ask HN: How do you use Docker in production?

#137

Docker explicitly violates the principles of the Twelve-Factor App. Docker apps don’t rely on any external environment. In fact, Docker demands that you store all config values, dependencies, everything inside of the container itself. Apps communicate with the rest of the world via ports and via Docker itself. The trade-off is that apps become a little bit bulkier (though not significantly), but the benefit is apps b…

[deleted]

Re: Ask HN: How do you use Docker in production?

#138
I'm solving the most obvious issues that docker was meant to solve. I'm currently working alone in a company that's starting up and yesterday I needed to spin up a server and create a rest api service to integrate with a telco's system. They asked me how long it would take me to do that and I said an hour. I just spun up a digital ocean instance, cloned my api git project, built from the docker file (it's incredibly fast on ssd), and in about 30 minutes I was running a nginx->uwsgi->flask with python3.4, bcrypt, and a few other packages.

Now all this can be done with a simple bash script too but then that affects my main server environment. In this case when I want to stop the service or change something I simply edit my docker image.

My dev environment is a windows laptop and I use vagrant to spin up a server with nginx configured and docker installed. And I use docker to get my environment running for working on my apps. It's pretty awesome.

Vagrant and docker are one of the best things that has happened for me as a developer.

Re: Ask HN: How do you use Docker in production?

#139
post #136
post #72

Earlier quoted context omitted.

So you're going to add a whole virtualization layer instead of just using "java -jar myapp.jar &"? Sorry, but what? And what do you mean about getting class paths right? Somehow I don't think best practice Java development necessarily calls for virtualization.

Docker is not a virtualization layer.

>Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating system–level virtualization on Linux.

Re: Ask HN: How do you use Docker in production?

#140
post #136

Earlier quoted context omitted.

Docker is not a virtualization layer.

>Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating system–level virtualization on Linux.

Docker is based on LinuX Containers (LXC), which are much more lightweight than a full OS VM. Containers are basically namespaces for processes, networks so I would expect way lower overhead than a full fledged VM.

More details here - http://stackoverflow.com/a/16048358/803923 http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dot...

It is a virtualization layer, but not nearly as heavyweight (and perhaps not as well isolated) as a full VM. As to the isolation - I don't know how "good" it is, but I expect it will only get better. I think this is what PG means by "do things that don't scale".

Post reply on HN