RFC: Add support for optional runtime hint using network options #1697
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.
docker supports alternate OCI runtimes including virtual machine based runtimes. In certian cases network plugins can optionally choose to support creation of virtual machine friendly interfaces using optional network options.
This is illustrated here with the hint being used by the macvlan driver to create a macvtap interface vs a macvlan interface when the runtime is known to be a VM based runtime.
docker run --runtime=cor -it --net=pub_net --network "name=pub_net,runtime=namespace" alpine sh
This is currently based off of
moby/moby#27638
However this will be implemented as per the proposal
moby/moby#31964
The drawback of this approach is that the runtime and the endpoint runtime type have to be specified twice. However this approach may work better with containerd, where I assume the namespace and interfaces will be created prior to the launch of the container, and there is no prehook involved.
Ideally this could be done by extending the OCI specification pre-hook definition and sending that information to the network plugin.
However that will not work consistently as the pre-hook is invoked after the EndpointCreate has occurred.
Some plugins create the interface at the time of Join and some at the time of Create.
Signed-off-by: Manohar Castelino [email protected]