Update runtime::container::start()
to take a new allow_local
flag
#1361
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This should fix an issue encountered by people running a local Flow stack under WSL. The problem is that in that case, Docker containers run in a separate VM to the one hosting the Linux VM, meaning that the container IP address exposed via
docker inspect
is not accessible from the "host". The solution here is to ask Docker to bind a port on the host to the corresponding port inside the container.In order to prevent binding every task to a host port in production (which runs Linux), we ended up turning off host-port mapping on Linux entirely because we didn't have a better way to identify local vs prod environments.
We have since introduced an
allow_local
flag, and can condition host-port mapping on that, enabling Flow to run inside WSL.Notes for reviewers:
I did also add a debug log so we can see the real
docker run
invocation. This might be noisy (but also, if you turn on debug logging noisy is kind of expected), but it's something I've reached for every time I've had to debug why this piece of code isn't working.This change is