Support DOCKER_NETWORK environment variable #1698
Merged
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.
When DOCKER_NETWORK is set, the bundle's invocation image is attached to the specified network, such as host or the minikube network.
I chose to not use the PORTER prefix because this seemed more consistent with the other DOCKER_ environment variables that Porter recognizes, such as DOCKER_HOST.
A user can specify a different docker network by setting an environment variable before running porter
What does this change
This is using a one-off tag of cnab-go to avoid pulling in a bunch of changes that are just for porter v1. This tag (v0.19.0-porter.3) just contains the previous cnab-go we were using with the main branch of porter and this latest change to cnab-go supporting docker network.
What issue does it fix
Closes #1696
When using Porter with oddball connectivity to an external resource, in this case the kubernetes cluster api from minikube which is only available from the host network or the minikube docker network, you can now tell porter which docker network to attache the bundle's installer to when it runs. This will allow devs to try out bundles when they are working with endpoints that are only available on their local dev machine and don't have a public endpoint.
Notes for the reviewer
The change is 100% in cnab-go.
Checklist