lundi 2 décembre 2019

How to append extra parameters to command in docker-compose?

I have a service defined in docker-compose.yml for running tests, which looks like this:

services:
  test:
    build:
      context: ..
      dockerfile: ./docker/Dockerfile
    image: myservice:latest
    command: sh -c "/path/to/very/long/command arg1 arg2 .."

In my test runner I need to pass an extra argument to the command. How can I do this without duplicating the whole command line, i.e. instead of :

docker-compose run --rm test /path/to/very/long/command arg1 arg2

run

docker-compose run --rm test arg3

?

Aucun commentaire:

Enregistrer un commentaire