-
Notifications
You must be signed in to change notification settings - Fork 40
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
Question: how to form a URI with expose
?
#187
Comments
Your best bet here is probably to write a wrapper script that sets the #!/bin/bash
export MONGODB_CONNSTRING=mongodb://guest:guest@localhost:${MONGO_PORT}/
exec $@ |
@dcrosta Thank you. I prefer going down the refactoring route, I think. That feels less "workaround-y", for lack of a better word. Please feel free to close this issue if you need to. :-) Do you think tox not expanding |
tox-docker 5.0.0 has deprecated `ports`; we need to use `expose` instead. This is a good change; with `expose` the services we use when testing should not conflict with any pre-existing services. We could have pinned to an older version of tox-docker, but older tox-docker sometimes errors out if the right version of requests (<=2.31.0) is not available. docker/docker-py#3256 A fallout of this change is that we can't use MONGODB_CONNSTRING anymore, since forming a URI using environment variables from tox appears to be rather awkward. tox-dev/tox-docker#187
I agree with your reading of the docs, and that does seem like a bug, yeah. I'd report it to https://github.com/tox-dev/tox |
I have an application that expects a
MONGODB_CONNSTRING
environment variable, and used atox.ini
like below:In the pre-5.0.0 days of tox-docker, the above
tox.ini
worked just fine in most cases. Now thatports
is deprecated, I am having a hard time with the newexpose
thing. This does not work:The above does not work because tox expands
MONGODB_CONNSTRING
tomongodb://guest:guest@localhost:/
. Tox does not raise an error here unlike what the documentation says.How can I form a
MONGODB_CONNSTRING
here? Refactoring the application to useMONGO_PORT
would be an inconvenience, since that code's "owner" is not me. Not everyone in the team uses tox-docker, so refactoring in that manner would be a hard-sell.Going back to older versions of tox-docker is also an inconvenience, because of this error:
The above is because of this docker-py issue. Now I have to pin requests at 2.31.0, which is a hassle, and may not be always possible.
The text was updated successfully, but these errors were encountered: