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
[BUG] docker compose run trying to map service ports? #11790
Comments
indeed. "one-off" container started by I guess your issue here is that you want to run with a dedicated |
It might be useful to call out this behavior explicitly in the documentation. I read the I need to run the tests in a separate instance of the services for state reasons. I want to have close control over the state of the application and service and not pollute / interfere with the state of my development environment. For example I want to cover the case of spinning up / updating the service containers in production. If I was running the tests against an already active instance of the application I would not get that. |
Description
I am using
docker compose --profile=tests --project=tests run
to run isolated tests in my development environment. The documentation of docker compose run states that no service ports will get published to the host unless --service-ports=true is specified.However, my tests www container seems to fail to start for failing to bind ports if I have my development container running at the same time. Note that the container being run is not the www container, but the tests container, which however depends_on the www container, My guess is that depends_on containers still expose their service ports even when no --service-ports=true is specified.
Output of
docker comose --verbose run
belowIf this is intended behavior, then the documentation for docker compose run should be explicit about it. Nothing currently makes it clear that this is how it's expected to work.
Steps To Reproduce
Container A that depends_on container B. Container B has published ports in the compose.yml. When container A is started with
docker compose run
, container B will get started as a dependency, too, but will have it's ports published, even though no--service-ports
was provided.Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: