Skip to content
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

Cli change to pass driver specific options to docker run #317

Closed
wants to merge 1 commit into from

Conversation

abhi
Copy link
Contributor

@abhi abhi commented Jul 10, 2017

Opened this PR since #156 was closed.

The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's.
The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since #62 . This commit extends this support to docker run command as well.
For docker connect command --driver-opt is added to pass driver specific options for the network the container is connecting to.

Following is supported:

docker run -itd --net name=docknet,alias=web1.0,driver-opt=field1=value1 alpine
docker run -itd --net name=docknet,driver-opt=field1=value1 --net-alias=web1.0 alpine
docker run -itd --net name=docknet --net-alias web1 alpine
docker connect network --driver-opt field1=value1 --alias=web2.0 docknet2 dockcontainer

Signed-off-by: Abhinandan Prativadi abhi@docker.com

@abhi
Copy link
Contributor Author

abhi commented Jul 10, 2017

ping @thaJeztah , @aaronlehmann

@codecov-io
Copy link

codecov-io commented Jul 10, 2017

Codecov Report

Merging #317 into master will decrease coverage by 0.07%.
The diff coverage is 30.76%.

@@            Coverage Diff             @@
##           master     #317      +/-   ##
==========================================
- Coverage   53.26%   53.18%   -0.08%     
==========================================
  Files         258      258              
  Lines       16357    16391      +34     
==========================================
+ Hits         8712     8718       +6     
- Misses       7081     7106      +25     
- Partials      564      567       +3

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhi could you add some (unit) tests to this PR?

@thaJeztah
Copy link
Member

Wondering; with this change, should we:

  • make "advanced syntax" and --network-alias a "conflict"?
  • can we support multiple --network= options on docker run, so that a container can be connected to multiple networks?

@thaJeztah
Copy link
Member

ping @abhi this needs a rebase; also can you have a look at my comment above?

The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's.
The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well.
For docker connect command --driver-opt is added to pass driver specific options for the network the container is connecting to.

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
@nobody-void
Copy link

I wonder if this PR is in progress.

@thaJeztah
Copy link
Member

carried in #1767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants