Hi, is there an option to develop inside docker co...
# general
m
Hi, is there an option to develop inside docker container? (Python project in this case)
b
Pants can both: • run within a docker container, as a normal CLI program • run natively, but invoke some commands within a docker container, using "environments": https://www.pantsbuild.org/prerelease/docs/using-pants/environments For more specific answers, can you provide more info about what you're trying to do?
m
That’s looking good! I’m moving our team right now from polyrepo to monorepo and in our current setup we’re developing inside docker containers and I’m thinking if we still need it but I wanted to see that the option is available if we want to :)
b
ah okay, yes. Depending on the exact details, I'd expect you can migrate without changing that part of the workflow (i.e. keep using docker) and then later reconsider whether docker is required or not
m
@broad-processor-92400 I tried using it today and I see that I can’t use docker environment for python sources and the run goal. Only for something like packaging a pex binary which doesn’t let me develop inside a docker container… am I wrong?
b
Ah, if docker environment doesn't work for that, then you should be able to fall back to the first option of executing pants itself within the docker container:
docker run -v ... some/image:tag pants test ::
and
docker run -v ... some/image:tag pants run ...
, etc. (or however you work within a docker container)