tox-dev / tox-docker

A tox plugin to run one or more Docker containers during tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RFC: Refactor container configuration

dcrosta opened this issue · comments

Tox-docker started simple, you just named a container and then moved on. Next we created dockerenv to define env vars passed to the container; then other options and the [docker:foo] sections. The result is kind of confusing and not very extensible. Various things depend on the image "basename", which makes #43 difficult.

In 2.0, I propose something like:

[testenv:whatever]
docker = 
    my-redis
    my-nginx
commands = ...

[docker:my-nginx]
image = nginx:1.10-alpine
env = ...
healthcheck_cmd = ...
# other healthcheck things
links =
    my-redis:redis

[docker:my-redis]
image = redis:5-alpine
# ...

In essence, all configuration is attached to a name that must only be unique within the tox.ini. The name shouldn't contain :, [, ], probably a few others. The name is also used as the key (LHS) for links.

Thoughts, folks? Any issues I'm not seeing?