Skip to content

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

Closed
abhi wants to merge 1 commit into
docker:masterfrom
abhi:drun
Closed

Cli change to pass driver specific options to docker run#317
abhi wants to merge 1 commit into
docker:masterfrom
abhi:drun

Conversation

@abhi

@abhi abhi commented Jul 10, 2017

Copy link
Copy Markdown
Contributor

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

abhi commented Jul 10, 2017

Copy link
Copy Markdown
Contributor Author

ping @thaJeztah , @aaronlehmann

@codecov-io

codecov-io commented Jul 10, 2017

Copy link
Copy Markdown

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

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

I wonder if this PR is in progress.

@thaJeztah

Copy link
Copy Markdown
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