Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support array of docker-compose files #211

Open
ghost opened this issue Dec 23, 2015 · 1 comment
Open

support array of docker-compose files #211

ghost opened this issue Dec 23, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 23, 2015

http://groupon.github.io/DotCi/user-guide/DockerCompose .ci.yml

docker-compose-file: "./jenkins/docker-compose.yml"

Currently, the code does not support an array of docker compose files

            if (dockerComposeCommand != null ) {
                shellCommands.add(String.format("docker-compose -f %s run -T %s %s", fileName, dockerComposeContainerName,SHELL_ESCAPE.escape((String) dockerComposeCommand)));
            }
            else {
                shellCommands.add(String.format("docker-compose -f %s run -T %s",fileName,dockerComposeContainerName));
            }
https://docs.docker.com/compose/extends/#understanding-multiple-compose-files says

By default, Compose reads two files, a docker-compose.yml and an optional docker-compose.override.yml file. By convention, the docker-compose.yml contains your base configuration. The override file, as its name implies, can contain configuration overrides for existing services or entirely new services.

Ideally instead DotCi could default to reads two different set of files, a docker-compose.yml and an optional docker-compose.dotci.yml, if available. This way the default docker-compose.override.yml best represents local developer environment. For example it can be configured to statically bind local ports for testing on dev machine. Whereas DotCi version can NOT perform static binding since parallel builds and other projects on the same slave would fail if that port is already bound.

This feature will help reinforce developer to be aware that docker-compose can support multiple files. The docker-compose.yml is to be a shared common definition that can be reused on localhost, dotci, and production. It should NOT contain test definition per best practice outlined in

https://docs.docker.com/compose/production/

$ docker-compose -f docker-compose.yml -f production.yml up -d

@ghost
Copy link
Author

ghost commented Feb 4, 2016

see #46 on pitfuls to avoid.

This supports why an array is necessary, so dev can make necessary changes to docker for ci
.... w/o effecting production docker image.

ghost pushed a commit to DotCi/test-npm-docker that referenced this issue Apr 8, 2016
ghost pushed a commit to DotCi/test-npm-docker that referenced this issue Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants