News for hackers. Stuff that matters.
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by StavrosK on Friday October 04, 2013 @08:08AM (#6494846)
I would very much like to use Docker/containers to provision and deploy my software stacks on a beefy server I have. The ideal for me would be a whole VM in a container (nginx/uwsgi/redis/postgres/etc), but Docker can't currently do that (it only runs a single process).

Is there a practical/good way to easily do what I want, with Docker or another tool?

Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by andreypopp on Friday October 04, 2013 @08:21AM (#6494888)
Did you try Dokku[1] (git hook + Heroku buildpacks + Docker)? You can build/deploy several apps to docker containers using git push. It has PostgreSQL plugin and exposes your app via nginx. Of course it wouldn't be 100% usable as-is, but its codebase is very hackable — around 150LOC.

For example I've forked it to built a μPaaS[2] — it has out-of-the-box integration with upstart (for supervision and logging) and replaced Heroku buildpacks with the ability to define stack in Dockerfile (which is much simpler).

[1]: https://github.com/progrium/dokku [2]: https://github.com/andreypopp/upaas

Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by StavrosK on Friday October 04, 2013 @08:44AM (#6494971)
The only reason I haven't tried it is because I've never really used Heroku, but I'll give it a shot now, thanks.
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by steeve on Friday October 04, 2013 @08:57AM (#6495035)
I actually spawn multiple processes thanks to supervisord, which also restarts them if needed.

See https://github.com/steeve/docker-lemp

Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by StavrosK on Friday October 04, 2013 @09:09AM (#6495090)
That's my preference as well, I just prefer upstart to supervisord. Does anyone know how to start it offhand? It's probably just as easy as running the upstart daemon.

EDIT: Well, supervisord looks straightforward, and you only need a single config file for everything. You have swayed me, thank you for that. This will do perfectly, I will try it today.

Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by windexh8er on Friday October 04, 2013 @09:16AM (#6495117)
Can't edit on mobile, but here's the example referenced:

https://github.com/dotcloud/collectd-graphite?files=1

Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by StavrosK on Friday October 04, 2013 @10:18AM (#6495488)
Fantastic, thank you. This is the approach I'll follow, and that looks very well structured.
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by windexh8er on Friday October 04, 2013 @09:15AM (#6495114)
There's a great example here of a well done Dockerfile and implementation using supervisor.
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by jasonkolb on Friday October 04, 2013 @09:16AM (#6495125)
Just create a bootstrap shell script that can be run on any machine. At a high level here's what mine does:

1) Install git 2) Clone a repo with all of the dockerfiles in it (each dockerfile corresponds to a container) 3) Install Docker 4) Start containers using the previously-mentioned scripts

The advantage to using a shell script for this is that you can start it manually or via an automated system. All you need is the bootstrap script and you can start your app on any machine. Well, apart from the distributions the post mentions I guess.

Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by StavrosK on Friday October 04, 2013 @10:17AM (#6495477)
This is what I want the Dockerfile to do for me. For some reason, I don't really want to manage all the different components' containers myself (it's added complexity).
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by asdfaoeu on Friday October 04, 2013 @08:12AM (#6494858)
It's not really limited to one process you can just run a bash script to start everything or ideally some daemon management program.
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by huxley on Friday October 04, 2013 @09:03AM (#6495061)
This might be interesting too:

Pipework

https://github.com/jpetazzo/pipework

Essentially it lets you create private networks between containers which could each run its own service (one for Postgres, one for Redis, etc).

Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by jaytaylor on Friday October 04, 2013 @03:43PM (#6497487)
You should checkout ShipBuilder [1][2]. ShipBuilder is a freely available open-source self-hosted PaaS -- it aims to be an open clone of Heroku.

It uses Go, LXC, and HAProxy.

[1] https://github.com/sendhub/shipbuilder

[2] http://shipbuilder.io

Disclaimer: I am a committer on the project

Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by StavrosK on Friday October 04, 2013 @03:50PM (#6497515)
Hmm, I had a look, but it's very light on documentation. So light, that it didn't really explain what the advantage is, or why I should try it, or how it works. (I tend to tune out the "open-source PaaS" offering because it's consistently been something too hard/heavy/weird to set up).
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by alexlarsson on Friday October 04, 2013 @08:11AM (#6494856)
The process docker runs in the container can be /sbin/init, which spawns an entire OS. Its just not how its normally used.
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by yackob03 on Friday October 04, 2013 @09:38AM (#6495257)
Correct me if I'm wrong, but as far as I know Docker actually does run a binary called /sbin/init, it's just that they've replaced it in the base images with something that is more suited for fast startup times and running of a single process. Setting the Docker start command to init will probably not accomplish what you want.
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by shykes on Friday October 04, 2013 @10:38AM (#6495602)
That was true in earlier versions of Docker, but has been fixed. alexlarsson is correct :)
Re:Docker + Red Hat OpenShift = The Tipping Point for Open P... by StavrosK on Friday October 04, 2013 @08:43AM (#6494966)
Hmm, I guess that could do it. I wonder if I can run the upstart daemon first to have it start my services. That would be ideal.