mercredi 31 janvier 2018

docker-compose execute command in sibling container

I am building an end to end test suite around a number of services. Some of these services aren't really services. They are actually procedural scripts which are run in sequence. These are executed at the command line and accept arguments, as you would expect a script to do.

We have docker images for these scripts/apps. I have compiled them into a docker-compose file. They are defined there as services which are sibling to the end to end test suite itself. So, for example:

docker-compose.yml

version: '3.4'
services:
  script:
    build: https://${GITHUB_ACCESS}:@github.com/company/script.git
    image: script:e2e
  e2e_tests:
    build: .
    image: e2e:e2e

Now, the e2e service needs to execute the script. Since the script isn't a service, I can't make a simple api call. How would I pass a command into the script container in order to execute it, from the e2e_tests container?

Aucun commentaire:

Enregistrer un commentaire