docker-compose.yml should support every docker run option
Notable things missing:
- [x] add-host https://github.com/docker/fig/issues/597 https://github.com/docker/compose/pull/1158
- [x] cpuset https://github.com/docker/compose/pull/685
- [x] device https://github.com/docker/compose/commit/df87bd91
- [x] memswap_limit https://github.com/docker/fig/pull/685
- [x] mac_address added in this commit: https://github.com/docker/compose/commit/b76ac6e6
The following run options aren't in docker-py; cpuset-mems, cpu-period, cpu-quota, oom-kill-disable, sig-proxy
Related: #363
Examples: https://github.com/docker/compose/pull/293 https://github.com/docker/compose/pull/830
Any progress with add-host https://github.com/docker/fig/issues/597? In docker-py support is already present https://github.com/docker/docker-py/pull/400 from 0.7.0.
Ideally if configuration would look like this
hosts:
hostname: ip
AFAICT support for "device" is also present in docker-py (see https://github.com/docker/docker-py/pull/373)
+1 for #597
I really need this feature: #597
@zhucegep you can try crane which supports it
@bfirsh are memswap_limit and cpuset not integrated into docker-compose yet?
also i'm trying to use cpu_shares which looks to be defined here, but doesn't seem to actually be working... https://github.com/docker/fig/blob/master/compose/service.py#L21
@mishak87 thank you, I had implement this feature on environment variable.
usage:
environment:
HOSTS: "zookeeper zookeeper.example.com\n172.17.42.1 my.own.com"
impl:
#! /bin/bash
echo "# host config by docker" >> /etc/hosts
echo "$HOSTS" | while read line
do
link_service_name=`echo $line | cut -d" " -f1`
ip=$link_service_name
# if does not contain "." then change it to ip from env
[[ $ip =~ "." ]] || ip=`env | grep TCP=tcp:// | grep -i $link_service_name | cut -d"/" -f3 | cut -d":" -f1 | sort | uniq`
# replace service name to ip, and echo to /etc/hosts
echo $line | sed s/$link_service_name/$ip/g >> /etc/hosts
done
+1 for #597
Any updates on docker-compose supporting the device option?:
--device=[] Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)
cpuset?
I've added some examples of pull requests adding docker-compose.yml options in case anybody needs an example to help them implement these.
@bfirsh cool, may I know why can't we add a fallback way to send whatever run param we want? so we are not always behind docker. Soon docker will have logs driver/limits, I'd love to use that even under a RC, but I can't without patching compose too.
Thanks
@imton IMO it is necessary to synchronize feature releases of docker with compose so it does not lag behind. Maybe using it for regression/integration tests so it is always necessary to keep it up-to-date.
But since receiving new name, lets hope it will be also receiving the attention it deserves!
@mishak87 while I understand what you say, I don't agree. I think docker changes so fast we have to have fallback and for docker's betas/RC we won't be updating compose.
TL;DR Current state leads to tools/forks like crane which implement more features and react faster. Maybe it would be faster to make decision on format/behaviour and let community to help out with implementation.
@imton That does not make sense to me from product perspective. We are talking about tool that orchestrates docker containers by reading single configuration.
I really do appreciate the pace with which docker keeps on significantly improving with each version, but leaving this tool in dust behind is bad. It would be like publishing golang 1.4 but only with tools supporting 1.3 features.
For a docker newcomer, composer is already part of official documentation. I would implicitly assume it is in lock with at least last stable version of docker. It is not useful to me for development and playing with, if I can't use new features.
From technical point of view it is confusing at least for me personally. I would expect compose to contain 90% of generated code from some hashmap of possible config values crossed with docker-py feature set. Maybe it would make sense to leave it with open-source community so you can focus on docker alone. Maybe you could decide how configuration should look like and ask for pull requests? I could promise you to make at least one each month for at least a year.
+1 for #597
+1 for #597
I want to help but there's no in-source docs :( – need add-hosts as well. How do you run the tests?
@tj Instructions on how to run the tests is in the contributing docs. Here's an example of adding an option if that's helpful: https://github.com/docker/compose/pull/830
Give us a shout in #docker-compose on Freenode if you need a hand with anything. :)