Before reading this is important:
I am not criticising docker in any bad way I am just sharing my concerns and questions.
It looks like that only way that I can run docker as daemon is to have some process in infinite loop.
/bin/sh -c "while true; do echo hello world; sleep 1; done"
Why docker containers can not be virtual private machines?
I read all of documentation and the thing is, for simple app container docker is great but what if I need little bit more complicated. Let me share few of my thoughts:
- Five Apache nodes
- Load balancer
- Mysql cluster
For 1,2 and 3
If I use haproxy i need static ips for my nodes. I just do not see how to do that with docker since I am getting some docker ips starting with 172. And if I stop/start/restart container that ip is changed. I read about pipework but that works only with linux (there is now way I can test it with OSX since pipework need /proc/mounts and that does not exists on OSX).
In general docker is great but as far as i can see if you need to do some more complicated, that maybe can be done.
With vps I can to apache balancing, mysqc lusters in half and hour.
I am not saying that vps is great.
Maybe I am wrong.
And finally about my question for daemon.
What is the point of running docker if i can not login into running container and do some changes or just to examing apache error logs or what ever. What if I have php app that is not running on port like python web aps (flask or django)? How to run that as deamon? If I do attach, first I can attach only to running containers and if i have some while loop if i attach to that specific container i can only see output of daemon command.
Little more on how questions:
And what about virtual hosts? I i have 10 vhosts in docker container i have to do some iptables in order to forward traffic to boot2docker ip (i have just one ip). What if I want to run 10 containers with apache/ngnix vhosts? How to forward traffic to different containers and finally how to setup dns records in order for that vhosts to work.
probably I need to have some hardware firewall in order to achieve that.
Why not have something like 1 container one ipv4 or ipv6 ip (public or private). That would solve every problem.
Maybe I am expecting to much.
I really would like to hear you opinion.