Commit Graph

601 Commits

Author SHA1 Message Date
08749b6912 Merge pull request #8571 from ncdc/3631-stdout-premature-eof
Fix stdout premature EOF
Upstream-commit: f936a10d8048f471d115978472006e1b58a7c67d
Component: engine
2014-10-29 11:36:32 -07:00
28bd6d74bf Fix compilation issue bringed by #8319
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 4da25724248d988771c2a546aa065505ceb24038
Component: engine
2014-10-29 09:31:35 -07:00
0a96e49cc3 Merge pull request #8319 from MalteJ/ipv6-ipallocator
Implementing IPv6 functionality for ipallocator
Upstream-commit: fd19e473fc81c8b58d82b1b77cd992c43faa64a8
Component: engine
2014-10-29 09:20:52 -07:00
ec0d91155f Merge pull request #8772 from aluzzardi/docker-info-mem-cpu
Expose # of CPUs and memory available on docker info.
Upstream-commit: eb1b785e67784ccc9b521566fbc1737d6177d9ad
Component: engine
2014-10-28 14:14:10 -07:00
657fc47397 Use archive.CopyWithTar in vfs.Create
The vfs storage driver currently shells out to the `cp` binary on the host
system to perform an 'archive' copy of the base image to a new directory.
The archive option preserves the modified time of the files which are created
but there was an issue where it was unable to preserve the modified time of
copied symbolic links on some host systems with an outdated version of `cp`.

This change no longer relies on the host system implementation and instead
utilizes the `CopyWithTar` function found in `pkg/archive` which is used
to copy from source to destination directory using a Tar archive, which
should correctly preserve file attributes.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: b6db23cffe942b8d94c80d1e9b3f1f6fca87d139
Component: engine
2014-10-27 11:38:22 -07:00
e6c9b85c85 Expose # of CPUs and memory available on docker info.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 61f8001c23dc4fbd7b1113f20b89a0dbade9aa82
Component: engine
2014-10-24 15:56:37 -07:00
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
29e2118279 Merge pull request #8315 from dqminh/save-start-error
Save start error into State.Error when the container fails to start
Upstream-commit: 9094c19a6d69f5adf438463f6a3c19f5dad42bd9
Component: engine
2014-10-24 13:13:00 -07:00
ecded68887 Merge pull request #8671 from shuai-z/master
Port number 49153(BeginPortRange) would be returned twice, causing dupli...
Upstream-commit: 0e6242122d9780709c057fc32e9970529c2e09fb
Component: engine
2014-10-23 17:37:38 -07:00
f5318af0df Merge pull request #8737 from brahmaroutu/resize_uponstart_8728
Allowing resize tty to only work when container is started
Upstream-commit: a71b2ec54ad7b5f809176c023ab22c7e062ad909
Component: engine
2014-10-23 17:20:10 -07:00
d9b4e1dcc3 Allowing resize tty to only work when container is started
Addresses #8728

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 78a272ce14a43f81a79f1b948d5cfd120405f8c9
Component: engine
2014-10-23 21:31:34 +00:00
deaa163ba3 Gracefully handle network bridge without IP association at startup
Addresses #8444

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 1262b5f605e8f897acb2b9ee261edbab7f1f8947
Component: engine
2014-10-23 16:19:12 -04:00
b91a2b389f added test, gofmtd
Signed-off-by: shuai-z <zs.broccoli@gmail.com>
Upstream-commit: 2c2edabca5471fa969358cb98619f277d585e76c
Component: engine
2014-10-23 11:35:12 +08:00
79574eea31 Port number 49153(BeginPortRange) would be returned twice, causing duplication and potential errors.
If we first request port 49153 (BeginPortRange) explicitly, and later some time request the next free port (of same ip/proto) by calling RequestPort() with port number 0, we will again get 49153 returned, even if it's currently in use. Because findPort() blindly retured BeginPortRange the first run, without checking if it has already been taken.

Signed-off-by: shuai-z <zs.broccoli@gmail.com>
Upstream-commit: 9451cf39eff037eccb04319c1e601d08495cab3c
Component: engine
2014-10-23 10:49:33 +08:00
98a7bd658b save start error into State.Error
when a container failed to start, saves the error message into State.Error so
that it can be retrieved when calling `docker inspect` instead of having to
look at the log

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: fb6ee865a949905f678aa7c7066c809664a8a4aa
Component: engine
2014-10-22 22:42:37 -04:00
7e904deb7c Fix stdout premature EOF
Never close attached stream before both stdout and stderr have written
all their buffered contents. Remove stdinCloser because it is not needed
any more as the stream is closed anyway after attach has finished.

Fixes #3631

Signed-off-by: Andy Goldstein <agoldste@redhat.com>
Upstream-commit: 5572dbb7504c951f4ddd2710a4037844a95caa6a
Component: engine
2014-10-22 16:34:42 -04:00
f69339516b Merge pull request #8665 from cpuguy83/8659_clean_paths_for_volumes
Clean volume paths
Upstream-commit: cf44d6f9cc8f1a84ea6e3c35a9f2d9b232d08d9b
Component: engine
2014-10-21 11:17:03 -04:00
94f641a2fe Make container.Copy support volumes
Fixes #1992

Right now when you `docker cp` a path which is in a volume, the cp
itself works, however you end up getting files that are in the
container's fs rather than the files in the volume (which is not in the
container's fs).
This makes it so when you `docker cp` a path that is in a volume it
follows the volume to the real path on the host.

archive.go has been modified so that when you do `docker cp mydata:/foo
.`, and /foo is the volume, the outputed folder is called "foo" instead
of the volume ID (because we are telling it to tar up
`/var/lib/docker/vfs/dir/<some id>` and not "foo", but the user would be
expecting "foo", not the ID

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: ef98fe0763024abd90bd5a573fec816895ee92e4
Component: engine
2014-10-20 20:23:01 -04:00
13b9038a18 Clean volume paths
Fixes #8659

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 964f9965c75b89f95060c62ba512ed6ceb525992
Component: engine
2014-10-20 19:07:56 -04:00
d5e9b821af Adding capability to filter by name, id or status to list containers api
Closes #7599

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 16346253537267b42bbf35e81c0139b4d0aee43c
Component: engine
2014-10-20 18:33:20 +00:00
9bac41ed10 Make daemon.Attach private
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 2db1caee4f23e81107b2647c06b4c677f6ecd7a1
Component: engine
2014-10-17 13:20:02 -07:00
5f681d731d Fix lxc driver build issue on Mac OS X
Docker-DCO-1.1-Signed-off-by: Albert Zhang <zhgwenming@gmail.com> (github: zhgwenming)
Upstream-commit: 210db1234dfb8d279bc1e5e2c8438dc8db2ee27d
Component: engine
2014-10-17 09:41:23 +08:00
cde87628c0 Merge pull request #8232 from vbatts/vbatts-devmapper_getDeps
devmapper: include dm_deps information in debug
Upstream-commit: 2f9ffe5b6ac1c547d1b5c228637007b05af48a3f
Component: engine
2014-10-16 14:13:21 -07:00
47427bd007 Setting iptables=false should propagate to ip-masq=false
Signed-off-by: Jessica Frazelle <jess@docker.com>
Upstream-commit: 3893e220e840054dfdadba637372bc30f683fe58
Component: engine
2014-10-16 11:52:14 -07:00
161436147c Disable stable IPs.
Stable IPs causes some regressions in the way people use Docker, see GH#8493.

Reverting it for 1.3, we'll enable it back for the next release.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 5b8379a4349105eb387a4b9836bbd1d83ebe6928
Component: engine
2014-10-09 15:15:17 -07:00
e30e6f7d0c Merge pull request #8457 from jfrazelle/pr_8455
Check /etc/resolv.conf every time for 127.* content
Upstream-commit: 4eb812e042e10e8158161ba7d6236a9ca8044ebe
Component: engine
2014-10-08 16:21:14 -07:00
d83fbbbf57 cleanup resolve.conf code
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: dbe6c6651e744bd6f6cab04fcaed2871779d36a0
Component: engine
2014-10-08 15:15:51 -07:00
939ae48706 Merge pull request #8450 from dqminh/fix-proxy-exit
dont close proxy's stdout/stderr prematurely
Upstream-commit: 0486bd022e7c51b23cc9b4d62b5faaf42ee9a101
Component: engine
2014-10-08 14:20:33 -07:00
87b92d77be Merge pull request #8475 from cpuguy83/fix_create_phantom_volumes_on_container_restart
Fixes re-creating volume on (re)start
Upstream-commit: d7bcc099bec2b0ee4ff5c6411ae33f9e23bd94d1
Component: engine
2014-10-08 13:58:56 -07:00
a61100d91a Fixes re-creating volume on (re)start
When a container is restarted all the volume configs are parsed again.
Even if the volume was already handled in a previous start it was still
calling "FindOrCreateVolume" on the volume repo causing a new volume to
be created.

This wasn't being detected because as part of the mount initialization
it checks to see if the the _mount_ was already initialized, but this
happens after the parsing of the configs.
So a check is added during parsing to skip a volume which was already
created for that container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c985302c5c2fb6d922acf29106b550cb36faaab6
Component: engine
2014-10-08 16:25:51 -04:00
153b47b46a Restore volume refs after daemon restart
Volume refs were not being restored on daemon restart.
This made it possible to remove a volume being used by other containers
after a daemon restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9acf7c765c7e074f6c75eaf162ca06ecfe40d692
Component: engine
2014-10-08 14:17:27 -04:00
3b41fdc9e8 pass extra file to child process as status handler
When stdout/stderr is closed prematurely, the proxy's writes to stdout/stderr
(i.e. `log.Errorf/log.Printf`) will returns with EPIPE error, and go runtime
will terminate the proxy when stdout/stderr writes trigger 10 EPIPE errors.

instead of using stdout/stderr as the status handler, we pass an extra file to
the child process and write `0\n` or `1\nerror message` to it and close it
after. This allow the child process to handle stdout/stderr as normal.

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: 3b9d88210e763bebdfd7badb6ed3fd507d0f6513
Component: engine
2014-10-08 12:53:43 -04:00
5e3424acb2 Check /etc/resolv.conf every time for 127.* content
Currently if you start the docker -d on a system with 127.0.0.1 in /etc/resolv.conf
It will set the default dns to 8.8.8.8 8.8.4.4 permanently.

This causes a problem at boot on Fedora machines where NetworkManager has not
populated /etc/resolv.conf before docker gets started.

This fix checks /etc/resolv.conf on every docker run. And only populates
daemon.config.Dns  if the user specified it on the command line.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 9ced509e6d89d1ab4e0c4b49485be7931b505354
Component: engine
2014-10-07 16:19:02 -04:00
dbcd84a852 Container#AllocateNetwork: Simplify error handling.
The defer logic was a little tricky and was hiding one bug: `err` was
being redefined (with `:=`) and thus it escaped the defer error checking
logic.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 300c51c3a4ca47b022eb2efb75d1e8cf7736b0ff
Component: engine
2014-10-06 17:59:12 -07:00
ba6185d6ef Fix #8398 - volumes copying data unexpectedly
Prior to the volumes re-factor, data was not being copied on
volumes-from or host-mounted volumes.
After the re-factor, data was being copied for volumes-from.
This reverts this unintentional change in behavior.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e95b6fb648ab6301b556192a9730a843fab7209f
Component: engine
2014-10-06 14:21:46 -04:00
505d3e474a Merge pull request #8392 from jfrazelle/pr_8389
Invalid mount mode for volumes in
Upstream-commit: 84d9fd37b05c22a61af2ab86c6783089b456790b
Component: engine
2014-10-03 17:22:21 -07:00
4380fb4361 Merge pull request #8297 from aluzzardi/f-stable-ip
Stable Networking: Keep the same network settings during the entire container lifecycle.
Upstream-commit: d152a93b5f3acbd14e9176169934b83963f3ab61
Component: engine
2014-10-03 14:19:46 -07:00
c05ce270f8 Fixes bad validMountMode check
Needed to check if the mode was invalid and return error, not valid and
return error.

This didn't get picked up because the existing integration-cli tests
were all either expecting errors when a valid mode was passed in (e.g.
"ro" passed in, we expected an error because it was testing write).  So
modified a test which was testing for "rw" to actually pass in "rw"
instead of assuming the "rw"

Docker-DCO-1.1-Signed-off-by: Brian Goff <bgoff@cpuguy83-mbp.home> (github: cpuguy83)
Upstream-commit: 007b4f63409c6c642fb075640a8ec7d58825edc8
Component: engine
2014-10-03 16:55:39 -04:00
bad1803f92 Stable MAC addresses: Add support for MAC address restoring.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: b669025949f1dba1ad3af9bab6711736863d6e24
Component: engine
2014-10-03 13:46:24 -07:00
e8d74130ef Daemon: Restore network settings at startup.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: f1087c5fcf070f151601f643418f3963facfea84
Component: engine
2014-10-03 13:46:24 -07:00
5b30bf9410 Stable Networking: Keep the same network settings across container restarts.
This change will allocate network settings (IP and public ports) at
container creation rather than start and keep them throughout the
lifetime of the container (i.e. until it gets destroyed) instead of
discarding them when the container is stopped.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: a4875937293f3b0a8ffc569608bbca40a456e9c8
Component: engine
2014-10-03 13:46:24 -07:00
2fa4089519 Container: Add restore network functionality.
RestoreNetwork() allows the container to restore its NetworkSettings (IP
and public ports).

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: deffc572ced3909c0ecd77dd21686e0e67c0ea33
Component: engine
2014-10-03 13:46:24 -07:00
6b98f72598 Container: Make allocateNetwork and releaseNetwork public.
Since we are moving network allocation outside of container scope (it
will be managed by create/destroy), those functions need to be
accessible from the outside.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: ab4188c08d9eb63c84c461a9b922f2af479b5a04
Component: engine
2014-10-03 13:46:24 -07:00
89c89a77ed Network Allocation: Proper rollback in case of failure allocation.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 103a4e0676f0099759e6f9a29ea1c9dc32766806
Component: engine
2014-10-03 13:46:24 -07:00
c852b13067 Merge pull request #8371 from aluzzardi/f-consistent-mac
Support for consistent MAC address.
Upstream-commit: beff5067c8b97b37c4fd7e9bee08a0adb8947c99
Component: engine
2014-10-03 13:28:03 -07:00
4418404026 Support for consistent MAC address.
Right now, MAC addresses are randomly generated by the kernel when
creating the veth interfaces.

This causes different issues related to ARP, such as #4581, #5737 and #8269.

This change adds support for consistent MAC addresses, guaranteeing that
an IP address will always end up with the same MAC address, no matter
what.

Since IP addresses are already guaranteed to be unique by the
IPAllocator, MAC addresses will inherit this property as well for free.

Consistent mac addresses is also a requirement for stable networking (#8297)
since re-using the same IP address on a different MAC address triggers the ARP
issue.

Finally, this change makes the MAC address accessible through docker
inspect, which fixes #4033.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 88e21c6a75310da158bbee3a5fdc135697c93ba1
Component: engine
2014-10-03 13:22:38 -07:00
9b0677b8de Merge pull request #8320 from dmcgowan/provenance_pull
Official image provenance pull flow
Upstream-commit: eaaf9e31258ca0af042e07c707f6bbb3afeb293b
Component: engine
2014-10-03 10:56:54 -07:00
57338d434f docker rm <unknown>
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 3eaa1c99c1acf8758175658450d58b15ddf0764a
Component: engine
2014-10-02 22:52:37 +00:00
4d78f5d6d8 Add provenance pull flow for official images
Add support for pulling signed images from a version 2 registry.
Only official images within the library namespace will be pull from the
new registry and check the build signature.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 7c88e8f13d9f0c68de6da0cd467a541231304dd5
Component: engine
2014-10-01 18:26:06 -07:00