docker / libcompose

*Unmaintained/Deprecated* An experimental go library providing Compose-like functionality
https://godoc.org/github.com/docker/libcompose
Apache License 2.0
585 stars 191 forks source link

Error when using group_add directive #446

Closed procrypt closed 7 years ago

procrypt commented 7 years ago

docker-compose group_add directive is supported by libcompose but when I run it with my docker-file containing group_add I get this

$ libcompose up
WARN[0000] Note: This is an experimental alternate implementation of the Compose CLI (https://github.com/docker/compose) 
ERRO[0000] Could not parse config for project komposefiles : Unsupported config option for web service: 'group_add' 
FATA[0000] Failed to read project: Unsupported config option for web service: 'group_add' 

docker-compose file

version: "2"
services:
  web:
    image: tuna/docker-counter23
    group_add:
      - sample
    ports:
      - "5000:5000"
  redis:
    image: redis:3.0
    ports:
      - "6379"

It works fine with docker-compose up.

$ docker-compose up
Starting komposefiles_web_1
komposefiles_redis_1 is up-to-date
Attaching to komposefiles_redis_1, komposefiles_web_1
redis_1  | 1:C 02 Mar 10:52:37.115 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1  |                 _._                                                  
redis_1  |            _.-``__ ''-._                                             
redis_1  |       _.-``    `.  `_.  ''-._           Redis 3.0.7 (00000000/0) 64 bit
redis_1  |   .-`` .-```.  ```\/    _.,_ ''-._                                   
redis_1  |  (    '      ,       .-`  | `,    )     Running in standalone mode
redis_1  |  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
redis_1  |  |    `-._   `._    /     _.-'    |     PID: 1
redis_1  |   `-._    `-._  `-./  _.-'    _.-'                                   
redis_1  |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
redis_1  |  |    `-._`-._        _.-'_.-'    |           http://redis.io        
redis_1  |   `-._    `-._`-.__.-'_.-'    _.-'                                   
redis_1  |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
redis_1  |  |    `-._`-._        _.-'_.-'    |                                  
redis_1  |   `-._    `-._`-.__.-'_.-'    _.-'                                   
redis_1  |       `-._    `-.__.-'    _.-'                                       
redis_1  |           `-._        _.-'                                           
redis_1  |               `-.__.-'                                               
redis_1  | 
redis_1  | 1:M 02 Mar 10:52:37.116 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis_1  | 1:M 02 Mar 10:52:37.116 # Server started, Redis version 3.0.7
redis_1  | 1:M 02 Mar 10:52:37.116 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1  | 1:M 02 Mar 10:52:37.116 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis_1  | 1:M 02 Mar 10:52:37.116 * The server is now ready to accept connections on port 6379
web_1    |  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
joshwget commented 7 years ago

There are some attributes I've implemented in our libcompose fork (including group_add). If anyone wants to beat me to this feel free to move these commits upstream. Might also be a good reference for adding new fields.