Commit graph

44 commits

Author SHA1 Message Date
Yong Tang
870beb70fb xFix issue for --hostname when running in "--net=host"
This fix tries to address the issue raised in 29129 where
"--hostname" not working when running in "--net=host" for
`docker run`.

The fix fixes the issue by not resetting the `container.Config.Hostname`
if the `Hostname` has already been assigned through `--hostname`.

An integration test has been added to cover the changes.

This fix fixes 29129.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit b0a7b0120f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:42:16 -08:00
Justin Cormack
0e386515c8 Fix grammar on error message
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit cd5c8e9c2d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:26:08 -08:00
Sebastiaan van Stijn
9a61bd05f8 Merge pull request #27466 from mrjana/net
Retry AttachNetwork when it fails to find network
2016-11-08 18:25:45 +01:00
Dong Chen
ca81f6ee7c dynamic service binding.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-11-04 21:50:56 -07:00
Madhu Venugopal
5f17e0f6c9 Handle NetworkDettach for the case of network-id
When a container is attached to an "--attachable" network, it strictly
forms the attacherKey using either the network-id or network-name
because at the time of attachment, the daemon may not have the network
downloaded locally from the manager. Hence, when the NetworkDettach is
called, it should use either network-name or network-id. This fix
addresses the missing network-id based dettachment case.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-11-03 15:56:35 -07:00
Jana Radhakrishnan
849e345e2c Retry AttachNetwork when it fails to find network
When trying to attach to swarm scope network for an unmanaged container
sometimes even if attaching to network succeeds, we may not find the
network because some other container which was using the network went
down and removed the network. So if it is not found, try to detach and
reattach to re-download the network from the manager.

Fixes #26588

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-11-01 21:46:24 -07:00
Madhu Venugopal
c5dd4d70c6 Copy only the relevant endpoint configs from Attachable config
When a container is run on a --attachable network, the endpoint
configs passed by the user were incorrectly overwritten.
Copy the relevant configs instead of overwriting the entire configs.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-10-29 17:11:30 -07:00
Michael Crosby
3343d234f3 Add basic prometheus support
This adds a metrics packages that creates additional metrics.  Add the
metrics endpoint to the docker api server under `/metrics`.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add metrics to daemon package

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

api: use standard way for metrics route

Also add "type" query parameter

Signed-off-by: Alexander Morozov <lk4d4@docker.com>

Convert timers to ms

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-10-27 10:34:38 -07:00
Yanqiang Miao
2d126f190d Delete a redundant error return
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-10-22 08:53:57 +08:00
John Howard
600f0ad211 Windows: Factor out unused fields in container
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-13 14:51:10 -07:00
Yanqiang Miao
9c3d1236d2 Delete the redundant function 'errClusterNetworkOnRun'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-24 11:24:48 +08:00
Sebastiaan van Stijn
8643903e49 Merge pull request #26805 from miaoyq/refactor-allocateNetwork
Replace two array with a map type, make it easier to understand.
2016-09-23 10:15:37 +02:00
Madhu Venugopal
d3139fc84a Merge pull request #25987 from msabansal/dnssupport
Support for Windows service discovery
2016-09-22 20:56:03 -07:00
Yanqiang Miao
1989b1b58c Replace two array with a map type, make it easier to understand.
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-23 09:52:05 +08:00
msabansal
d1e0a78614 Changes required to support windows service discovery
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-09-22 12:21:21 -07:00
msabansal
50f02b585c Fixed support for docker compose by allowing connect/disconnect on stopped containers
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-09-21 13:29:17 -07:00
Daniel Nephin
c452e1bfe6 Move errors/ to api/errors
Using:
        gomvpkg -from github.com/docker/docker/errors
                -to github.com/docker/docker/api/errors
                -vcs_mv_cmd "git mv {{.Src}} {{.Dst}}"

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-16 12:27:13 -04:00
Jana Radhakrishnan
c9fb551d60 Fix autostart for swarm scope connected containers
The swarm scope network connected containers with autostart enabled
there was a dependency problem with the cluster to be initialized before
we can autostart them. With the current container restart code happening
before cluster init, these containers were not getting autostarted
properly. Added a fix to delay the container start of those containers
which has atleast one swarm scope endpoint to until after the cluster is
initialized.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-13 14:21:58 -07:00
Jana Radhakrishnan
99a98ccc14 Add support for docker run in swarm mode overlay
This PR adds support for running regular containers to be connected to
swarm mode multi-host network so that:
    - containers connected to the same network across the cluster can
      discover and connect to each other.
    - Get access to services(and their associated loadbalancers)
      connected to the same network

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 21:20:41 -07:00
Michael Crosby
91e197d614 Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00
Madhu Venugopal
05a3f2666e Support container disconnect for non-existing network
There are cases such as migrating from classic overlay network to the
swarm-mode networking (without kv-store), such a mechanism to allow
disconnecting a container even when a network isnt available will be
useful.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-08-26 16:48:52 -07:00
Michael Crosby
5632768a0f Merge pull request #22208 from msabansal/staticip
Enabling specifying static ip for predefined network on windows
2016-08-12 11:39:25 -07:00
Alessandro Boch
3a3f800ff4 Fix regression on --link on bridge network
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-22 18:52:46 -07:00
Francis Chuang
1205a55846
Fix a grammatical error in errClusterNetworkOnRun()'s error message.
Signed-off-by: Francis Chuang <francis.chuang@boostport.com>
2016-07-05 16:18:06 +10:00
msabansal
1991f6ebd6 Enabling specifying static ip for predefined network on windows
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-06-30 14:33:27 -07:00
Aaron Lehmann
fa04558ac1 Fix "sanbox" typos
Correcting "sanbox" to "sandbox".

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-06-24 12:04:26 -07:00
Alexander Morozov
1bbac428de Merge pull request #23011 from coolljt0725/fix_link
Fix link doesn't work sometimes when container start with multiple networks
2016-06-20 09:42:13 -07:00
Lei Jitang
ecffb6d58c Daemon to support network restore
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-06-14 16:45:25 -07:00
Tonis Tiigi
534a90a993 Add Swarm management backend
As described in our ROADMAP.md, introduce new Swarm management API
endpoints relying on swarmkit to deploy services. It currently vendors
docker/engine-api changes.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-06-13 22:16:18 -07:00
Kai Qiang Wu(Kennan)
1cac7e6cbd Fix wrong map usage
As map reference, if all networks use same, it could cause strange
results.
Closes: #23304
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-06-08 14:36:47 +00:00
Lei Jitang
57c0a653e3 Fix link doesn't work sometimes when container start with multiple networks
If there is multiple networks to connect to on container starting,
the order of these networks is random because we "range a map". But
the defautl network "bridge" should be connected first since only
"bridge" support link and we should have do some settings on sandbox
creation, and only the first connect will setting the sandbox.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-05-26 03:20:53 -04:00
Alessandro Boch
f198dfd856 Update port info on network connect/disconnect
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-25 17:02:50 -07:00
Yong Tang
90bd41a74d The option --add-host and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--add-host` and `--net=host` to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-24 18:49:11 -07:00
Yong Tang
23821fe586 The option --dns, --dns-search, --dns-opt and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--dns`, `--dns-search`, `--dns-opt` and `--net=host`
to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-24 16:03:26 -07:00
Wen Cheng Ma
c52a373bc8 update link comments
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2016-05-09 14:12:28 +08:00
Madhu Venugopal
ea531f061d Add container's short-id as default network alias
link feature in docker0 bridge by default provides short-id as a
container alias. With built-in SD feature, providing a container
short-id as a network alias will fill that gap.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-04-18 14:45:16 -07:00
Sebastiaan van Stijn
fc352287c1 Merge pull request #21816 from estesp/case-of-the-missing-else
Don't perform external setkey when net==host
2016-04-07 17:01:30 -07:00
Phil Estes
1771d35b48 Don't perform external setkey when net==host
This else case was lost in the migration from native execdriver to OCI
implementation via runc. There is no need to have external setkey when
--net=host.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-04-06 16:45:43 -04:00
John Howard
331c8a86d4 Windows: Remove TP4 support from main code
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-06 12:12:20 -07:00
Tonis Tiigi
05cc737f54 Fix container mount cleanup issues
- Refactor generic and path based cleanup functions into a single function.
- Include aufs and zfs mounts in the mounts cleanup.
- Containers that receive exit event on restore don't require manual cleanup.
- Make missing sandbox id message a warning because currently sandboxes are always cleared on startup. libnetwork#975
- Don't unmount volumes for containers that don't have base path. Shouldn't be needed after #21372

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-30 17:25:49 -07:00
Tonis Tiigi
9c4570a958 Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-03-18 13:38:32 -07:00
Tim Hockin
53c5de2921 Don't smoosh hostname and domainname in API
This allows users to provide a FQDN as hostname or to use distinct hostname and
domainname parts.  Depends on https://github.com/docker/libnetwork/pull/950

Signed-off-by: Tim Hockin <thockin@google.com>
2016-03-15 08:32:35 -07:00
msabansal
e8026d8a98 Windows libnetwork integration
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-03-09 20:33:21 -08:00
David Calavera
6bb0d1816a Move Container to its own package.
So other packages don't need to import the daemon package when they
want to use this struct.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-12-03 17:39:49 +01:00