tox-docker icon indicating copy to clipboard operation
tox-docker copied to clipboard

Question: Running commands prior to docker calls

Open chayim opened this issue 3 years ago • 1 comments

I have a series of dockers I'd like to run, and each require some very light configuration, prior to triggering them. Is there any way to run commands, prior to the dockers starting, for a tox environment?

I tried adding commands_pre but that runs after the dockers are initialized. Is there something else I'm missing that works? While I can hack things together with this plugin it feels like this should be something in tox-docker.

chayim avatar Dec 09 '21 14:12 chayim

Do you need to run the commands inside or outside the container? For commands inside the container, you should use a custom Dockerfile to have the container do what you need. (In a pinch, you could probably find a way to abuse the healthcheck to do this as well, although that's not the intent of that feature, either in tox-docker or docker itself)

If you need to run commands outside the container, can your CI system invoke those commands before running tox?

dcrosta avatar Jan 17 '22 19:01 dcrosta