Commit graph

2296 commits

Author SHA1 Message Date
John Howard
340e5233b2 Windows: stats support
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 11:56:15 -07:00
Aaron Lehmann
a1fc3852da Merge pull request #26512 from AkihiroSuda/fix-pkg-plugins-racy-test
[test] fix racy test in pkg/plugins
2016-09-15 20:11:03 -07:00
Akihiro Suda
4bc908ec89 fix racy test in pkg/plugins
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-16 01:43:35 +00:00
Alexander Morozov
b2263c111f Merge pull request #26511 from AkihiroSuda/fix-pkg-archive-racy-test
[test] fix racy tests in pkg/archive
2016-09-15 11:10:34 -07:00
Aaron Lehmann
f8eab6fea8 progress: Rate limit progress bar output
ProgressReader outputs progress information every 500 KB. This could be
excessive if something is being transfered at a fast rate. Rate-limit
progress output to 10 per second.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-09-14 17:23:16 -07:00
Akihiro Suda
62cbd2589f fix racy tests in pkg/archive
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-14 04:17:23 +00:00
Vincent Demeester
675144ff8d Merge pull request #26514 from AkihiroSuda/fix-pkg-integration-race
[test] fix races in pkg/integration/cmd
2016-09-13 15:18:41 +02:00
Aleksa Sarai
2f7596aaef
apparmor: do not save profile to /etc/apparmor.d
Writing the profile to /etc/apparmor.d, while also manually loading it
into the kernel results in quite a bit of confusion. In addition, it
means that people using apparmor but have /etc mounted read-only cannot
use apparmor at all on a Docker host.

Fix this by writing the profile to a temporary directory and deleting it
after it's been inserted.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-09-13 16:25:16 +10:00
Akihiro Suda
e17f77ec51 fix races in pkg/integration/cmd
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-13 04:23:36 +00:00
Chun Chen
0699b00d26 Add default timeout to pkg/plugins/client
Signed-off-by: Chun Chen <ramichen@tencent.com>
2016-09-12 10:39:32 +08:00
Stephen J Day
9d7be9df8f tlsconfig: move Clone into proper package
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-09-09 12:05:17 -07:00
Michael Crosby
c1f2776bf1 Merge pull request #26428 from darrenstahlmsft/AddToSymlink
Don't attempt to evaluate drive root on Windows
2016-09-09 09:09:24 -07:00
Darren Stahl
fdce2a7775 Don't attempt to evaluate drive root on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-08 13:52:54 -07:00
Daniel Nephin
9c2b935812 Replace api/client imports with cli/command in experimental files.
Using

git grep -l 'client\.DockerCli' cli/command/stack/ | xargs sed -i -e 's/client\.DockerCli/command\.Dockercli/g'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 15:46:48 -04:00
Alexander Morozov
d959e7fac4 Merge pull request #26107 from dnephin/client_cleanup
Shrink the DockerCLI type
2016-09-08 12:18:46 -07:00
Aaron Lehmann
bc06542a17 Merge pull request #25523 from dmcgowan/fsync-layer-filestore
Update layer store to sync transaction files before committing
2016-09-08 10:03:12 -07:00
Daniel Nephin
a0ab33124a Extract stream output handling to a new type.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 12:33:41 -04:00
Brian Goff
28d18b8205 Merge pull request #25578 from rwilliams/conemu
Force input stream ANSI emulation for ConEmu.
2016-09-08 11:12:33 -04:00
Brian Goff
2381c7f18d Merge pull request #26281 from LK4D4/fix_multireader_offset
pkg/ioutils: fix multireader SEEK_CUR branch
2016-09-06 20:47:03 -04:00
Alexander Morozov
f3627c3726 pkg/ioutils: fix multireader SEEK_CUR branch
Before getReaderForOffset returned always nil and wrong offset.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-06 11:08:35 -07:00
Tonis Tiigi
7a8c7b47cf Fix govet for go1.7
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-02 19:07:54 -07:00
Michal Wieczorek
52c0daad82 fix spec file support for Windows plugin discovery (#25903)
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
2016-08-26 22:11:58 +02:00
Daniel Nephin
14712f9ff0 Remove old cli framework.
Also consolidate the leftover packages under cli.
Remove pkg/mflag.
Make manpage generation work with new cobra layout.
Remove remaining mflag and fix tests after rebase with master.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:04 -04:00
Daniel Nephin
7c556849aa Add testutil/tempfile
Improve error messages raised by assert.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:03 -04:00
Vincent Demeester
4d590ba44a Merge pull request #25967 from valgaze/feat/lewin
Add Daniel Lewin to names collection
2016-08-24 20:28:55 +02:00
Vincent Demeester
4a1b048c15 Merge pull request #25959 from estesp/fail-on-graphdir-perms
Don't start daemon in userns mode if graphdir inaccessible
2016-08-24 20:15:58 +02:00
Daniel Nephin
b29558ed5d Merge pull request #25426 from dnephin/better-int-testing-cmd
Remove duplicate RunCommand functions used for integration-cli
2016-08-24 11:34:24 -04:00
Phil Estes
43a1df6be2
Don't start daemon in userns mode if graphdir inaccessible
Warn the user and fail daemon start if the graphdir path has any
elements which will deny access to the remapped root uid/gid.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-08-24 11:25:30 -04:00
Phil Estes
76a416ac37
Add system.Stat support for darwin/macOS
darwin had unbuildable support for our system.Stat() implementation.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-08-24 11:25:26 -04:00
Victor Algaze
479b793a3e Add Joan Clarke to name collection
Signed-off-by: Victor Algaze <valgaze@gmail.com>
2016-08-24 01:58:48 -07:00
Victor Algaze
bc0e2f1a6e Add Daniel Lewin to names collection
Signed-off-by: Victor Algaze <valgaze@gmail.com>
2016-08-23 23:24:29 -07:00
Yong Tang
9cb8fb6ea0 Fix AuthZ plugins headers change issue
This fix tries to address the issue raised in 25927 where
the HTTP headers have been chaged when AUthZ plugin is in
place.

This issue is that in `FlushAll` (`pkg/authorization/response.go`),
the headers have been written (with `WriteHeader`) before all the
headers have bee copied.

This fix fixes the issue by placing `WriteHeader` after.

A test has been added to cover the changes.`

This fix fixes 25927

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-23 21:08:23 -07:00
Brian Goff
8c5c2842ba Merge pull request #25903 from anusha-ragunathan/windows_plugin_spec
Add spec file support for Windows plugin discovery.
2016-08-23 19:45:54 -04:00
Daniel Nephin
243885808f Change to use c.Assert() instead of result.Assert()
Fix delete containers and make sure it prints errors correctly.
Rename Result.Fails to Result.Assert()
Create a constant for the default expected.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:12:36 -04:00
Daniel Nephin
d7022f2b46 Create a unified RunCommand function with Assert()
Remove some run functions and replace them with the unified run command.
Remove DockerCmdWithStdoutStderr
Remove many duplicate runCommand functions.
Also add dockerCmdWithResult()
Allow Result.Assert() to ignore the error message if an exit status is expected.
Fix race in DockerSuite.TestDockerInspectMultipleNetwork
Fix flaky test DockerSuite.TestRunInteractiveWithRestartPolicy

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:11:46 -04:00
Daniel Nephin
fb42e84772 Remove unnecessary json.Unmarshal wrapper.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:11:46 -04:00
Ji.Zhilong
5e505d101f devmapper: prevent libdevmapper from deleting device symlinks in RemoveDeviceDeferred
if there is no cookie set in dm task, or flag DM_UDEV_DISABLE_LIBRARY_FALLBACK
is cleared for a DM_DEV_REMOVE task, libdevmapper will fallback to clean up the
symlink under /dev/mapper by itself, no matter the device removal is executed
immediately or deferred by the kernel.In some cases, the removal is deferred by the
kernel, while the symlink is deleted directly by libdevmapper, when docker tries to
activate the device again, the deferred removal will be canceld, but the symlink will
not show up again, so docker's attempt to mount the device by the symlink will fail,
and it will eventually leads to a `docker start/diff` error.

Fixes #24671

Signed-off-by: Ji.Zhilong <zhilongji@gmail.com>
2016-08-23 23:58:53 +08:00
Anusha Ragunathan
36cf93fb0c Add spec file support for Windows plugin discovery.
Plugin discovery on Windows is not possible using named pipes. However,
it is possible using spec file (tcp based). This adds Windows specific
paths for discovery.

Fixes #23605

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-08-22 09:14:57 -07:00
Phil Estes
dc950567c1 Use real chroot if daemon is running in a user namespace
The namespace unshare+pivot root is not possible when running inside a
user namespace, so fallback to the original "real" chroot code.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-08-12 16:31:01 -04:00
Serge Hallyn
617c352e92 Don't create devices if in a user namespace
If we are running in a user namespace, don't try to mknod as
it won't be allowed.  libcontainer will bind-mount the host's
devices over files in the container anyway, so it's not needed.

The chrootarchive package does a chroot (without mounting /proc) before
its work, so we cannot check /proc/self/uid_map when we need to.  So
compute it in advance and pass it along with the tar options.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-08-12 16:26:58 -04:00
Michael Crosby
2c50035f93 Merge pull request #24717 from icaoweiwei/patch_2016-07-16_1
Add output of integer argument
2016-08-12 10:54:01 -07:00
Vincent Demeester
64f83cee43 Merge pull request #25568 from thaJeztah/enhance-string-truncate
Implement stringutils.Ellipsis()
2016-08-12 17:19:50 +02:00
Michael Crosby
3011a41d3f Merge pull request #25561 from allencloud/make-more-pkgs-support-darwin
make more pkgs support darwin
2016-08-11 14:17:57 -07:00
Sebastiaan van Stijn
51dc35cf23
Implement stringutils.Ellipsis()
This patch implements an Ellipsis utility to
append an ellipsis (...)  when truncating
strings in output.

It also fixes the existing Truncate() utility
to be compatible with unicode/multibyte characters.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-11 14:14:06 +02:00
Ron Williams
0fd4bbda2d Force input stream ANSI emulation for ConEmu.
Signed-off-by: Ron Williams <ron.a.williams@gmail.com>
2016-08-10 11:24:12 -07:00
Alexander Morozov
64605d709f Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
2016-08-10 11:07:15 -07:00
allencloud
bd11a269bc make more pkgs support darwin
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-10 22:56:05 +08:00
allencloud
0ead624473 add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-10 08:36:09 +08:00
Derek McGowan
c37bd10f8c Update layer store to sync transaction files before committing
Fixes case where shutdown occurs before content is synced to disked
on layer creation. This case can leave the layer store in an bad
state and require manual recovery. This change ensures all files
are synced to disk before a layer is committed. Any shutdown that
occurs will only cause the layer to not show up but will allow it to
be repulled or recreated without error.

Added generic io logic to ioutils package to abstract it out of
the layer store package.


Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2016-08-09 11:55:17 -07:00
Sebastiaan van Stijn
91853e44ae Merge pull request #25415 from avaid96/exitret
added functionality to interrupt the terminal when it is waiting for …
2016-08-09 16:47:54 +02:00
Vincent Demeester
b2b3cb7be9 Merge pull request #22770 from twistlock/22729_dynamic_authz_reload
Enable to dynamically reload authorization plugins via daemon.config
2016-08-05 19:38:40 +02:00
Avi Vaid
c4b07f4683 added functionality to interrupt the terminal when it is waiting for an input
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
2016-08-04 10:00:02 -07:00
Sebastiaan van Stijn
87e48ecd04 Merge pull request #23497 from shishir-a412ed/dm_task_run_failed
Fixes Issue # 23418: Race condition between device deferred removal and resume device.
2016-08-03 21:54:33 +02:00
Sebastiaan van Stijn
b47df1ddbe Merge pull request #25105 from hqhq/fix_kmem_test
Fix TestUpdateKernelMemoryUninitialized on new kernel version
2016-08-02 17:15:53 +02:00
Shishir Mahajan
0e633ee14a Fixes Issue # 23418: Race condition between device deferred removal and resume device.
Problem Description:

An example scenario that involves deferred removal
1. A new base image gets created (e.g. 'docker load -i'). The base device is activated and
mounted at some point in time during image creation.
2. While image creation is in progress, a privileged container is started
from another image and the host's mount name space is shared with this
container ('docker run --privileged -v /:/host').
3. Image creation completes and the base device gets unmounted. However,
as the privileged container still holds a reference on the base image
mount point, the base device cannot be removed right away. So it gets
flagged for deferred removal.
4. Next, the privileged container terminates and thus its reference to the
base image mount point gets released. The base device (which is flagged
for deferred removal) may now be cleaned up by the device-mapper. This
opens up an opportunity for a race between a 'kworker' thread (executing
the do_deferred_remove() function) and the Docker daemon (executing the
CreateSnapDevice() function).

This PR cancel the deferred removal, if the device is marked for it. And reschedule the
deferred removal later after the device is resumed successfully.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-08-02 10:33:58 -04:00
Qiang Huang
da5d66fb70 Fix TestUpdateKernelMemoryUninitialized on new kernel version
Fixes: #25073

Update kernel memory on running containers without initialized
is forbidden only on kernel version older than 4.6.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-02 13:17:20 +08:00
Stefan J. Wernli
d0b9c33f71 Revert "Add checking err for IsWindowsClient()"
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-08-01 17:33:41 -07:00
Sebastiaan van Stijn
f2fb28cbb3 Merge pull request #25294 from klinden/patch-1
adding entry for Hugh Beaver
2016-08-02 01:01:13 +02:00
Kyle Linden
653d083c1e Add entries for Hugh Beaver, Lois Haibt and some more adjectives
Signed-off-by: Kyle Linden <kyle.linden@appliedis.com>
2016-08-01 16:05:27 -04:00
Sebastiaan van Stijn
d2eb5dc9e0 Merge pull request #24821 from thaJeztah/stringid-refactor
Minor refactor and beter coverage for pkg/stringid
2016-08-01 21:12:14 +02:00
allencloud
a91f59d487 make pkg pidfile support darwin
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-01 22:01:20 +08:00
Sebastiaan van Stijn
4554e60651 Merge pull request #25066 from lixiaobing10051267/masterErr
Add checking err for IsWindowsClient()
2016-07-30 17:25:08 +01:00
Liron Levin
4192fe9c06 Enable to dynamically reload authorization plugins via daemon.config
Following #22729, enable to dynamically reload/remove the daemon
authorization plugins (via standard reloading mechanism).
https://docs.docker.com/engine/reference/commandline/daemon/#daemon-
configuration-file

Daemon must store a reference to the authorization middleware to refresh
the plugin on configuration changes.

Signed-off-by: Liron Levin <liron@twistlock.com>
2016-07-30 14:59:07 +03:00
Sebastiaan van Stijn
1e6fd0378b Merge pull request #24081 from Microsoft/jjh/signaltofile
Windows: Stack dump to file
2016-07-29 22:09:35 +02:00
Alexander Morozov
170abb5f7c Merge pull request #24745 from daehyeok/logrus
Refactoring for logrus formatting
2016-07-28 16:50:19 -07:00
lixiaobing10051267
1df9f0932e Modify func name from TestChtimes to TestChtimesLinux
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

Modify func note

Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-07-27 10:05:59 +08:00
Brian Goff
bb27d017f3 Merge pull request #25086 from dmcgowan/overlay2-fix-sub-directory-whiteouts
Fix overlay2 sub directory whiteouts
2016-07-26 20:45:41 -04:00
Derek McGowan
1c0f6653ba Fix files in subdirectories creating bad whiteout
Closes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-07-26 12:03:55 -07:00
lixiaobing10051267
b4833e3b3d add to check err
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-07-26 21:43:32 +08:00
Akihiro Suda
b1e71bdd1d Fix pkg/plugins TLSConfig panic
Fix #25046

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-07-26 08:53:54 +00:00
Vincent Demeester
bff9a0556f Merge pull request #24961 from jstarks/vt_th2_fix
Windows: Restore console mode on set mode failure
2016-07-25 09:49:34 +02:00
Vincent Demeester
1f3b400d3c Merge pull request #24977 from lixiaobing10051267/masterNote
Modify several fun notes in fsnotify.go
2016-07-25 09:41:17 +02:00
Vincent Demeester
40044cb18f Merge pull request #24963 from allencloud/fix-typos
fix typos
2016-07-25 09:39:48 +02:00
lixiaobing10051267
ff2c898652 Modify several fun notes in fsnotify.go
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-07-24 13:35:33 +08:00
lixiaobing10051267
d6556a6ef7 Func name wrong in notes of response.go
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-07-23 16:03:27 +08:00
allencloud
4e959ef2f7 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-23 11:32:23 +08:00
John Starks
83c186fdd4 Windows: Restore console mode on set mode failure
SetConsoleMode() on input handles appears to remember invalid bits that
were set, causing problems for other programs (such as xcopy.exe) trying
to set the console mode after docker.exe has exited. Always restore
the input console mode on set failure.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-07-22 18:34:15 -07:00
John Howard
b63c92bf24 Windows: Stack dump to file
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-21 20:04:47 -07:00
Sebastiaan van Stijn
78eab14d0b
Minor refactor and beter coverage for pkg/stringid
This slightly simplifies TruncateID() by only
trimming the string if needed.

Also improved unit-tests for this package;

- Add a test for GenerateNonCryptoID()
- Add a test for shortening a sha-256 ID
- Make TestShortenId() more "unit", by using a fixed string, instead of calling GenerateRandomID()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-20 00:23:06 +02:00
Vincent Demeester
6875f71d7c Merge pull request #24776 from anusha-ragunathan/plugins-connect
Add only legacy plugins to the legacy lookup map.
2016-07-19 17:11:50 +02:00
Doron Podoleanu
6bec735c91 Use const http status code instead of just numbers see #24783
Signed-off-by: Doron Podoleanu <doronp@il.ibm.com>
2016-07-19 10:40:20 +03:00
Tibor Vass
e6a97db2c9 Merge pull request #23878 from jstarks/fix_windows_console
Windows: Always enable VT emulation
2016-07-18 16:23:04 -07:00
Anusha Ragunathan
8fd779dc28 Add only legacy plugins to the legacy lookup map.
Legacy plugin model maintained a map of plugins. This is
not used by the new model. Using this map in the new model
causes incorrect lookup of plugins. This change uses adds
a plugin to the map only if its legacy.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-18 15:43:44 -07:00
Daehyeok Mun
6a1183b3ae Refactoring for logrus formatting
Use module name logrus instead of log.
Use logrus.[Error|Warn|Debug|Fatal|Panic|Info]f instead of w/o f

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-07-18 12:53:34 -06:00
Arnaud Porterie
98a4b3e332 Merge pull request #24714 from allencloud/better-docker-network-create-help-output
better command `docker network create -h` output
2016-07-18 16:05:46 +00:00
Cao Weiwei
9be8bf0194 Fix a wrong word in comment.
Signed-off-by: Cao Weiwei <cao.weiwei30@zte.com.cn>
2016-07-17 13:08:07 +08:00
Cao Weiwei
3fc9a9ccb8 Fix a syntax error in comments
Signed-off-by: Cao Weiwei <cao.weiwei30@zte.com.cn>
2016-07-16 22:41:04 +08:00
Cao Weiwei
627839072c Add output of integer argument
Signed-off-by: Cao Weiwei <cao.weiwei30@zte.com.cn>
2016-07-16 20:20:00 +08:00
allencloud
d0081a0f47 better command docker network create -h output
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-16 15:32:17 +08:00
allencloud
416613f2e5 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-12 00:59:30 +08:00
Justin Cormack
0682468431 Make the docker proxy a standalone binary not a re-exec
This reduces memory usage with a lot of docker proxy processes.
On Docker for Mac we are currently carrying a patch to replace
the binary as we modify it to forward ports to the Mac rather
than the Linux VM, this allows us to simply replace this binary
in our packaging with one that has a compatible interface. This
patch does not provide an easy way to substitute a binary as
the interface is complex and there are few use cases, but where
needed this can be done.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-07 12:53:39 +01:00
Brian Goff
56f3422468 Use newer default values for mounts CLI
In the API:
`Writable` changed to `ReadOnly`
`Populate` changed to `NoCopy`

Corresponding CLI options updated to:
`volume-writable` changed to `volume-readonly`
`volume-populate` changed to `volume-nocopy`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-06 22:34:39 -04:00
Sebastiaan van Stijn
92766c4b83 Merge pull request #22472 from allencloud/make-pkg-fileutils-support-darwin
add fileutils_darwin.go in pkg/fileutils to support darwin platform
2016-07-02 14:15:22 -07:00
Shourya Sarcar
39dd365c5e Add Andrew Wiles, Florence Nightingale, Thomas Edison to container names.
British mathematician Andrew Wiles is notable for solving Fermat's LAst
Theorem. Florence Nightingale was the first female inducted into the
Royal Statistical Society. Thomas Alva Edison was a prolific inventor,
noted for inventing the incandescent light bulb, the phonograph and the
motion picture camera (among many other).

Signed-off-by: Shourya Sarcar <shourya.sarcar@gmail.com>
2016-07-02 02:56:03 +00:00
allencloud
d2dd1a1f7d add fileutils_darwin.go in pkg/fileutils to support darwin platform
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-01 13:02:26 +08:00
Yong Tang
f3d8658fff Fix s390x build failure by removing golang.org/x/sys
This fix tries to fix the issue raised in #24168 where
golang.org/x/sys causes s390x build failure.

This fix removed the import of "golang.org/x/sys/unix".

This fix fixes #24168.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-30 06:32:32 -07:00
Sebastiaan van Stijn
cbf785c45a Merge pull request #24080 from dmcgowan/atomic-writer-mode
Set permission on atomic file write
2016-06-30 01:00:08 -07:00
Derek McGowan
1cd7490281 Set permission on atomic file write
Perform chmod before rename with the atomic file writer.
Ensure writeErr is set on short write and file is removed on write error.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-29 13:09:13 -07:00
Sebastiaan van Stijn
50a173e3d5 Merge pull request #23955 from yongtang/23768-cpu-count
Fix wrong CPU count after CPU hot-plugging
2016-06-29 12:00:13 -07:00
Daniel Nephin
07b59ef210 Fix service update of Args
add a unit test

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-29 12:41:57 -04:00
Yong Tang
3707a76921 Fix wrong CPU count after CPU hot-plugging on Windows
This fix tries to fix wrong CPU count after CPU hot-plugging.
On windows, GetProcessAffinityMask has been used to probe the
number of CPUs in real time.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-25 22:20:29 -07:00
Yong Tang
8b2383f5c1 Fix wrong CPU count after CPU hot-plugging
This fix tries to address issues raised in #23768 where the CPU count
is not updated after cpu ho-plugging.

This fix follows the suggestion from #23768 and replace go's `runtime.NumCPU()`
with `sysconf(_SC_NPROCESSORS_ONLN)` so that correct CPU count could
be obtained even after CPU hot-plugging.

This fix is tested manually, as is suggested in #23768.

This fix fixes #23768.

The NumCPU() in Linux is based on @wmark 's implementation.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-25 20:48:36 -07:00
Vincent Demeester
296b5c761f Merge pull request #23918 from LK4D4/avoid_copy
pkg/pools: avoid copy of sync.Pool
2016-06-24 19:35:43 +02:00
Alexander Morozov
ba3af336eb pkg/pools: avoid copy of sync.Pool
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-06-23 16:09:13 -07:00
Vincent Demeester
37fe4bdb59 Merge pull request #23912 from dmcgowan/fix-overlay2-whiteout-exclusion
Fix overlay2 ignoring whiteout files
2016-06-24 01:06:38 +02:00
Derek McGowan
bd13c53f8d Fix overlay2 ignoring whiteout files
Currently when overlay creates a whiteout file then the overlay2 layer is archived,
the correct tar header will be created for the whiteout file, but the tar logic will then attempt to open the file causing a failure.
When tar encounters such failures the file is skipped and excluded for the archive, causing the whiteout to be ignored.
By skipping the copy of empty files, no open attempt will be made on whiteout files.

Fixes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-23 13:34:38 -07:00
John Starks
4acc2c7499 Windows: Always enable VT emulation
Always enable VT output emulation when starting the process so that
non-attaching commands can still output VT codes.

Also remove the version block for using the native console and just rely
on supported flags being present.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-06-23 13:14:39 -07:00
bin liu
950073aabb fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-21 15:29:25 +08:00
Daniel Nephin
c0ea589c1b Add some tests for bundlefile and improve the error messages for LoadFile
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-16 18:18:25 -04:00
Tibor Vass
f37117045c plugins: experimental support for new plugin management
This patch introduces a new experimental engine-level plugin management
with a new API and command line. Plugins can be distributed via a Docker
registry, and their lifecycle is managed by the engine.
This makes plugins a first-class construct.

For more background, have a look at issue #20363.

Documentation is in a separate commit. If you want to understand how the
new plugin system works, you can start by reading the documentation.

Note: backwards compatibility with existing plugins is maintained,
albeit they won't benefit from the advantages of the new system.

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-14 14:20:27 -07:00
Vincent Demeester
5338ae7133 Merge pull request #23425 from runcom/authz-race
pkg: authorization: lock when lazy loading
2016-06-13 23:20:37 +02:00
Michael Crosby
8a2f9a249c Merge pull request #22126 from dmcgowan/overlay-native-diff
Overlay multiple lower directory support
2016-06-13 13:15:39 -07:00
Alexander Morozov
8eb1d89c17 Merge pull request #22631 from runcom/fix-leak-mount
pkg: chrootarchive: chroot_linux: fix mount leak
2016-06-13 09:29:46 -07:00
Antonio Murdaca
d1b7e8373b authz: cleanups
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-12 17:23:19 +02:00
Antonio Murdaca
ceb9c5a88b pkg: authorization: lock when lazy loading
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-12 17:19:43 +02:00
Yong Tang
a72b45dbec Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

This fix fixes #23459.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-11 13:16:55 -07:00
Vincent Demeester
ec1790d7f1 Merge pull request #23458 from runcom/warnf
*: fix logrus.Warn[f]
2016-06-11 21:42:12 +02:00
Antonio Murdaca
44ccbb317c *: fix logrus.Warn[f]
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-11 19:42:38 +02:00
Antonio Murdaca
809207fc74 pkg: proxy: fix TCPEchoServer.Close() in unit test
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-11 15:27:56 +02:00
Antonio Murdaca
7d22887b2c pkg: chrootarchive: chroot_linux: fix mount leak
When pivot_root fails we need to unmount the bind mounted path we
previously mounted in preparation for pivot_root.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-11 00:07:41 +02:00
fortinux
cd7ca2a1c7
update peaceful zen
Signed-off-by: fortinux <info@fortinux.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-10 16:39:05 +02:00
Aleksa Sarai
e6d856df43 pkg: archive: only ignore ENOTSUP when xattr fails
There might be other (valid) reasons for setxattr(2) to fail, so only
ignore it when it's a not supported error (ENOTSUP). Otherwise, bail.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-06-10 00:56:40 +10:00
Derek McGowan
8222c86360 Update archive package to support overlay whiteouts
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-08 00:10:16 -07:00
Viktor Stanchev
b03d3232d1 aufs compatibility
Signed-off-by: Viktor Stanchev <me@viktorstanchev.com>
2016-06-08 00:10:16 -07:00
Tibor Vass
ccaea227e0 Cleanup
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-06 15:57:51 -07:00
Alexander Morozov
b32478488c ioutils: fix race in access closeErr in bytespipe
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-06-06 11:29:47 -07:00
Brian Goff
2f40b1b281 Add support for volume scopes
This is similar to network scopes where a volume can either be `local`
or `global`. A `global` volume is one that exists across the entire
cluster where as a `local` volume exists on a single engine.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-05 15:37:15 -04:00
Brian Goff
79ff6eaf21 Enhance pluginrpc-gen parser
Now handles `package.Type` and `*package.Type`
Fixes parsing issues with slice and map types.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-05 15:37:15 -04:00
Sven Dowideit
98c245c9e6 Merge pull request #23193 from allencloud/fix-typos
use grep to find all a/an typos
2016-06-02 18:45:08 -07:00
Alexander Morozov
6e5894b551 pkg/parser/kernel: remove unused var block
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-06-02 10:50:36 -07:00
Alexander Morozov
34f54b3a11 Merge pull request #22549 from allencloud/make-pkg-parsers-support-darwin
add darwin support in package docker/pkg/parsers
2016-06-02 10:48:19 -07:00
Vincent Demeester
f69353a364 Merge pull request #23153 from AkihiroSuda/fix23152PkgGitutils
Fix gitconfig dependency in pkg/gitutils.TestCheckoutGit
2016-06-02 17:21:38 +02:00
Sebastiaan van Stijn
171af54931 Merge pull request #22460 from jwhonce/wip/sigpipe
Ignore SIGPIPE events
2016-06-02 16:05:22 +02:00
allencloud
c1be45fa38 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-02 17:17:22 +08:00
Akihiro Suda
efc250bc6b Fix gitconfig dependency in pkg/gitutils.TestCheckoutGit
Fix #23152

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-06-02 17:44:09 +09:00
allencloud
a7f551359a make pkg/parsers support darwin and solaris
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-02 11:47:27 +08:00
Brian Goff
7e5561a438 Merge pull request #23151 from AkihiroSuda/fix23012PkgAuth
Fix racy tests in pkg/authorization
2016-06-01 20:45:54 -04:00
Akihiro Suda
f437e2d148 Fix racy tests in pkg/authorization
Fix #23012

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-06-01 03:25:56 +00:00
Akihiro Suda
da7edb5f3c Fix pkg/streamformatter.TestJSONFormatProgress
The test was failing if the terminal column width is <= 110.

Addendum to #23113

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-05-31 09:09:06 +00:00
Lei Jitang
ba372df79c Merge pull request #23113 from AkihiroSuda/fixTIOCGWINSZ23112
Fix pkg/jsonmessage.TestProgress panic
2016-05-31 14:58:55 +08:00
Alexander Morozov
a1f1e9c6d9 Merge pull request #23038 from AkihiroSuda/fixPkgDirectoryFilepathWalk
Fix filepath.Walk misusage in pkg/directory
2016-05-30 22:18:56 -07:00
Akihiro Suda
709478c8a3 Fix pkg/jsonmessage.TestProgress panic
Fix #23112

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-05-31 04:19:00 +00:00
Akihiro Suda
cd53ec5244 Fix filepath.Walk misusage in pkg/directory
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-05-30 07:40:46 +00:00
Darren Shepherd
cc5024225a Change insane to infallible
Signed-off-by: Darren Shepherd <darren@rancher.com>
2016-05-28 09:49:34 -07:00
Brian Goff
9369457603 Merge pull request #23041 from AkihiroSuda/fixPkgDiscoveryKvTestTooShortSleep
Fix too short time.Sleep() in pkg/discovery/kv/kv_test.go
2016-05-27 21:11:33 -04:00
Arnaud Porterie
fd7ec4b9e5 Merge pull request #22912 from duglin/FixImportTest
Fix docker import test
2016-05-27 14:03:44 -07:00
Akihiro Suda
937851580c Fix too short time.Sleep() in pkg/discovery/kv/kv_test.go
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-05-27 04:08:55 +00:00
Yong Tang
397a6fefad Inconsistent --tmpfs behavior
This fix tries to address the issue raised in #22420. When
`--tmpfs` is specified with `/tmp`, the default value is
`rw,nosuid,nodev,noexec,relatime,size=65536k`. When `--tmpfs`
is specified with `/tmp:rw`, then the value changed to
`rw,nosuid,nodev,noexec,relatime`.

The reason for such an inconsistency is because docker tries
to add `size=65536k` option only when user provides no option.

This fix tries to address this issue by always pre-progating
`size=65536k` along with `rw,nosuid,nodev,noexec,relatime`.
If user provides a different value (e.g., `size=8192k`), it
will override the `size=65536k` anyway since the combined
options will be parsed and merged to remove any duplicates.

Additional test cases have been added to cover the changes
in this fix.

This fix fixes #22420.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-26 19:28:18 -07:00
allencloud
e18296f4f0 make package docker/pkg/platform support darwin
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-05-26 11:10:29 +08:00
Alexander Morozov
e010610828 Merge pull request #22951 from Microsoft/jjh/ise2
Windows: run -it not crash in PowerShell ISE
2016-05-25 16:50:06 -07:00
John Howard
486a1a03d8 Windows: run -it not crash in ISE
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-25 09:50:18 -07:00
Brian Goff
53e2deb159 Merge pull request #22973 from AkihiroSuda/fix22965IntegrationRace
Fix a race in pkg/integration.TestChannelBufferTimeout
2016-05-25 11:35:23 -04:00
Akihiro Suda
d0d828e292 Fix a race in pkg/integration.TestChannelBufferTimeout
Update #22965

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-05-25 07:09:38 +00:00
Akihiro Suda
1f8fbbc0d8 Fix a race in pkg/discovery/memory
Fix #22964

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-05-25 04:01:43 +00:00
Brian Goff
29dbcbad87 Merge pull request #22925 from jstarks/fix_integration_test
pkg/integration: Port tests to Windows
2016-05-24 17:31:43 -04:00
John Starks
8fc825364a pkg/integration: Port tests to Windows
Signed-off-by: John Starks <jostarks@microsoft.com>
2016-05-24 12:12:48 -07:00
Amit Krishnan
86d8758e2b Get the Docker Engine to build clean on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
2016-05-23 16:37:12 -07:00
Doug Davis
ac043c7db6 Fix docker import tests
For me when I run the test I see:
```
Downloading from http://nourl/bad
Importing    283 B
Untar re-exec error: exit status 1: output: unexpected EOF
```
and nothing about "dial tcp" so it appears that the output is
system dependent and therefore we can't really check it. I think
checking for non-zero exit code is sufficient so I'm removing this
string check.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-23 15:34:40 -07:00
Jhon Honce
55a367d2fe Ignore SIGPIPE events, resolves #19728
Using golang 1.6, is it now possible to ignore SIGPIPE events on
stdout/stderr.  Previous versions of the golang library cached 10
events and then killed the process receiving the events.

systemd-journald sends SIGPIPE events when jounald is restarted and
the target of the unit file writes to stdout/stderr. Docker logs to stdout/stderr.

This patch silently ignores all SIGPIPE events.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2016-05-23 15:26:41 -07:00
Sebastiaan van Stijn
91bc4cca58 Merge pull request #22875 from Microsoft/jjh/nativeconsoleon
Windows: Turn on native console by default
2016-05-23 21:19:54 +02:00
John Howard
ef2db56bcf Windows: Default to Hyper-V Containers on client
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-21 11:29:53 -07:00
John Howard
c152dc48e5 Windows: Turn on native console by default
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-20 19:19:26 -07:00
Vincent Demeester
29fe2f34d2 Merge pull request #22588 from runcom/fix-authz-tests
pkg: authorization: cleanup tests
2016-05-13 10:29:45 +02:00
Alexander Morozov
350832acfa Merge pull request #22698 from cpuguy83/22612_fix_map_access
Fix concurrent map access in bytespipe
2016-05-12 11:51:54 -07:00
Brian Goff
194c72611d Fix concurrent map access in bytespipe
When getting and returning a buffer, need to make sure to syncronize
access to the pools map.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-05-12 10:04:05 -04:00
Arnaud Porterie
b3a1ae02a9 Merge pull request #22353 from Microsoft/jjh/dockercp
Windows: docker cp platform semantically consistent paths
2016-05-11 13:08:24 -10:00
Alexander Morozov
34175eb47e pkg/proxy: remove unused 'transfered' variable
That simplified code a bit

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-05-10 14:33:21 -07:00
Antonio Murdaca
5248f5c3d1 pkg: chrootarchive: chroot_linux: fix docker build
The path we're trying to remove doesn't exist after a successful
chroot+chdir because a / is only appended after pivot_root is
successful and so we can't cleanup anymore with the old path.
Also fix leaking .pivot_root dirs under /var/lib/docker/tmp/docker-builder*
on error.

Fix https://github.com/docker/docker/issues/22587
Introduced by https://github.com/docker/docker/pull/22506

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-10 00:42:49 +02:00
Antonio Murdaca
6a96684442 pkg: authorization: cleanup tests
- do use use log pkg
- do not t.Fatal in goroutine
- cleanups

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-08 14:18:38 +02:00
Vincent Demeester
08ec3606f1 Merge pull request #21889 from cpuguy83/logscmd_add_attrs
Add support for reading logs extra attrs
2016-05-07 20:26:33 +02:00
Brian Goff
bd9d14a07b Add support for reading logs extra attrs
The jsonlog logger currently allows specifying envs and labels that
should be propagated to the log message, however there has been no way
to read that back.

This adds a new API option to enable inserting these attrs back to the
log reader.

With timestamps, this looks like so:
```
92016-04-08T15:28:09.835913720Z foo=bar,hello=world hello
```

The extra attrs are comma separated before the log message but after
timestamps.

Without timestaps it looks like so:
```
foo=bar,hello=world hello
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-05-06 20:42:20 -04:00
John Howard
7f66598583 Windows: docker cp consistent paths
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-06 16:08:53 -07:00
unclejack
eb52730570 Merge pull request #22506 from cpuguy83/no_chroot
Use pivot_root instead of chroot for chrootarchive
2016-05-06 14:21:23 -07:00
Doug Davis
cc01017bcf Merge pull request #22550 from allencloud/fix-typos
fix typos in comments
2016-05-06 08:56:33 -04:00
allencloud
3f77baf2ce fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-05-06 18:23:11 +08:00
Vincent Demeester
bb125650c9 Merge pull request #21015 from cpuguy83/add_opaque_mount_id
When calling volume driver Mount, send opaque ID
2016-05-05 18:00:15 +02:00
Brian Goff
85988b33d2 Use pivot_root instead of chroot for chrootarchive
This fixes one issue with Docker running under a grsec kernel, which
denies chmod and mknod under chroot.

Note, if pivot_root fails it will still fallback to chroot.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-05-04 19:55:34 -04:00
Anuj Bahuguna
fd8a6775f5 Adding Rita Levi-Montalcini and Claude Shannon to name generator
Signed-off-by: Anuj Bahuguna "anujbahuguna.dev@gmail.com"

Signed-off-by: Anuj Bahuguna <abahuguna@fiberlink.com>
2016-05-04 00:14:09 +05:30
Phil Estes
62bd539629 Add Joan & Samuel Curran, Welsh scientest and Irish physicist couple
In honor of Betty Junod's cast, and her tweet about Joan Curran:
https://twitter.com/BettyJunod/status/727194712956784641

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-05-02 14:50:16 -04:00
Liron Levin
526abc00b1 Fix authorization issue - when request is denied return forbbiden exist code (403).
- Return 403 (forbidden) when request is denied in authorization flows
(including integration test)
- Fix #22428
- Close #22431

Signed-off-by: Liron Levin <liron@twistlock.com>
2016-05-02 19:14:48 +03:00
Brian Goff
2b6bc294fc When calling volume driver Mount, send opaque ID
This generates an ID string for calls to Mount/Unmount, allowing drivers
to differentiate between two callers of `Mount` and `Unmount`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-29 09:37:02 -04:00
Brian Goff
dbee44c9e0 Merge pull request #21613 from wzyboy/support-unixgram-syslog-address
Support unixgram syslog address
2016-04-28 11:06:17 -04:00
Zhuoyun Wei
57fad95e43
Support unixgram syslog address
- Consider unixgram:// as a valid URL prefix
- Parse unixgram:// addresses
- Update docs

Signed-off-by: Zhuoyun Wei <wzyboy@wzyboy.org>
2016-04-28 11:04:50 +08:00
John Starks
fab67ab677 Windows: revendor Azure/go-ansiterm
go-ansiterm was previously pulling the testing package into the docker
binaries.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-04-25 15:57:59 -07:00
Tonis Tiigi
ea3cbd3274 Safer file io for configuration files
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-21 11:31:15 -07:00
Vincent Demeester
483063ad85 Merge pull request #22203 from alimate/name-gen-patch
Added Lamport & Agnesi to the list of scientists
2016-04-20 21:03:18 +02:00
Ali Dehghani
85e880205f Added Lamport & Agnesi to the list of scientists
Leslie B. Lamport is an American computer scientist. Lamport is
best known for his seminal work in distributed systems and as the
initial developer of the document preparation system LaTeX.
Maria Gaetana Agnesi was an Italian mathematician, philosopher,
theologian and humanitarian. She was the first woman to write a
mathematics handbook and the first woman appointed as a Mathematics
Professor at a University.

Signed-off-by: Ali Dehghani <ali.dehghani.g@gmail.com>
2016-04-20 21:44:22 +04:30
Madhu Venugopal
de806a672b Initialize activateWait for plugins activated by json spec
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-04-20 05:59:19 -07:00
Vincent Demeester
49f7b4dafb
Remove pkg/version
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-04-19 16:57:02 +02:00
David Calavera
aeb1e45e60 Merge pull request #22130 from Microsoft/jstarks/win_pidfile
Windows: don't overwrite PID file if process exists
2016-04-18 19:45:18 -07:00
John Starks
9e5b93565c Windows: don't overwrite PID file if process exists
pidfile.New() was opening a file in /proc to determine if the owning
process still exists. Use syscall.OpenProcess() on Windows instead.

Other OSes may also need to be updated here.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-04-18 16:41:37 -07:00
Amit Krishnan
b216dc9115 Get pkg/term to build for Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
2016-04-15 14:18:26 -07:00
Tõnis Tiigi
1a14bbc61e Merge pull request #21726 from aaronlehmann/tarsum-filename-normalization
Fix build cache false positives when build context tar contains unnormalized paths
2016-04-15 09:45:26 -07:00
Aaron Lehmann
8691a77e44 Fix build cache false positives when build context tar contains unnormalized paths
If a build context tar has path names of the form 'x/./y', they will be
stored in this unnormalized form internally by tarsum. When the builder
walks the untarred directory tree and queries hashes for each relative
path, it will query paths of the form 'x/y', and they will not be found.

To correct this, have tarsum normalize path names by calling Clean.

Add a test to detect this caching false positive.

Fixes #21715

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-04-14 17:57:45 -07:00
Tonis Tiigi
4d4ef98326 Fix panic on winsize syscall
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-13 17:08:00 -07:00
Alexander Morozov
9438572fc0 Merge pull request #21897 from calavera/remove_authorization_refs_from_api
Move middleware to interfaces.
2016-04-12 14:08:36 -07:00
Aleksa Sarai
5ee0a94101 pkg: listeners: move Docker-specific semantics to docker/daemon*
Since there are other users of pkg/listeners, it doesn't make sense to
contain Docker-specific semantics and warnings inside it. To that end,
move the scary warning about -tlsverify and the libnetwork port
allocation code to CmdDaemon (where they belong). This helps massively
reduce the dependency tree for users of pkg/listeners.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-04-12 12:50:43 +10:00
David Calavera
8d3467626e
Move middleware to interfaces.
This makes separating middlewares from the core api easier.
As an example, the authorization middleware is moved to
it's own package.

Initialize all static middlewares when the server is created, reducing
allocations every time a route is wrapper with the middlewares.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-04-11 09:19:27 -07:00
Vincent Demeester
417fce0b77 Merge pull request #21906 from allencloud/fix-typos-pkg
fix typos in pkg
2016-04-09 18:50:42 +02:00
allencloud
aef02273d9 fix typos in pkg
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-04-09 21:18:15 +08:00
Victor Vieux
76122f95e9 fix typo in comment
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-04-08 00:05:31 -07:00
Alexander Morozov
9b2c3aa894 pkg/archive: use more narrow interface for CompressStream
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-04-07 13:21:05 -07:00
Brian Goff
4f8a6f3e02 Merge pull request #21840 from tonistiigi/fix-closing-attach-streams
Fix closing attach streams on lost tcp connection
2016-04-07 12:02:33 -04:00
Vincent Demeester
d5dfc4e526 Merge pull request #21820 from estesp/lazy-init-useradd
Lazy init useradd and remove init()
2016-04-07 10:09:02 +02:00
Tonis Tiigi
a47cd63915 Fix closing attach streams on lost tcp connection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-06 21:27:47 -07:00
Phil Estes
c6f45fd2ee Lazy init useradd and remove init()
This should not have been in init() as it causes these lookups to happen
in all reexecs of the Docker binary. The only time it needs to be
resolved is when a user is added, which is extremely rare.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-04-06 17:53:45 -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
John Howard
fc9912fd00 Merge pull request #21272 from Microsoft/jstarks/manifest_updates
Add os_version and os_features to Image
2016-04-05 16:16:25 -07:00
Alexander Morozov
806a8e22b9 Merge pull request #21755 from cpuguy83/bytespipe_allocs
Improve performance/reduce allocs of bytespipe
2016-04-05 14:43:57 -07:00
Brian Goff
9a25b1d942 Improve performance/reduce allocs of bytespipe
Creates a `fixedBuffer` type that is used to encapsulate functionality
for reading/writing from the underlying byte slices.

Uses lazily-loaded set of sync.Pools for storing buffers that are no
longer needed so they can be re-used.

```
benchmark                     old ns/op     new ns/op     delta
BenchmarkBytesPipeWrite-8     138469        48985         -64.62%
BenchmarkBytesPipeRead-8      130922        56601         -56.77%

benchmark                     old allocs     new allocs     delta
BenchmarkBytesPipeWrite-8     18             8              -55.56%
BenchmarkBytesPipeRead-8      0              0              +0.00%

benchmark                     old bytes     new bytes     delta
BenchmarkBytesPipeWrite-8     66903         1649          -97.54%
BenchmarkBytesPipeRead-8      0             1             +Inf%
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-05 13:06:04 -04:00
Lars Butler
0cad90911f Fix spelling error in names-generator.go
Signed-off-by: Lars Butler <Lars.Butler@gmail.com>
2016-04-05 12:34:52 +02:00
John Starks
194eaa5c0f Add os_version and os_features to Image
These fields are needed to specify the exact version of Windows that an
image can run on. They may be useful for other platforms in the future.

This also changes image.store.Create to validate that the loaded image is
supported on the current machine. This change affects Linux as well, since
it now validates the architecture and OS fields.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-04-04 13:14:57 -07:00
Aleksa Sarai
619bf56778 pkg: listeners: clean up to act like a library
Now that listeners is no longer an internal of the client, make it less
Docker-specific (despite there still being some open questions as how to
deal with some of the warnings that listeners has to emit). We should
move as much of the Docker-specific stuff (especially the port
allocation) to docker/ where it belongs (or maybe pass a check function).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-04-02 01:09:29 +11:00
Aleksa Sarai
e3a8c8388f pkg: listeners: separate out the listeners package
This code will be used in containerd and is quite useful in general to
people who want a nice way of creating listeners from proto://address
arguments (even supporting socket activation). Separate it out from
docker/ so people can use it much more easily.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-04-02 01:09:29 +11:00
Alexander Morozov
ad4750cf3a Merge pull request #21694 from LK4D4/remove_unused_pkg
pkg: cleanup some unused code
2016-03-31 15:06:35 -07:00
Alexander Morozov
07b568cb53 pkg: cleanup some unused code
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-03-31 11:39:59 -07:00
Alexander Morozov
2d18ed7e4b Merge pull request #21356 from cpuguy83/stdcopy_allocs
Optimizations for StdWriter
2016-03-31 10:54:45 -07:00
Tõnis Tiigi
553edd1d19 Merge pull request #21251 from cyphar/refactor-copyonbuild
pkg: archive: don't fail Untar if xattrs are not supported
2016-03-28 16:15:18 -07:00
Dmitri Logvinenko
6dede879fd Fix misspellings
Signed-off-by: Dmitri Logvinenko <dmitri.logvinenko@gmail.com>
2016-03-28 16:21:02 +03:00
Brian Goff
2f3b602285 Optimizations for StdWriter
Avoids allocations and copying by using a buffer pool for intermediate
writes.

```
benchmark            old ns/op     new ns/op     delta
BenchmarkWrite-8     996           175           -82.43%

benchmark            old MB/s     new MB/s     speedup
BenchmarkWrite-8     4414.48      25069.46     5.68x

benchmark            old allocs     new allocs     delta
BenchmarkWrite-8     2              0              -100.00%

benchmark            old bytes     new bytes     delta
BenchmarkWrite-8     4616          0             -100.00%
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-25 22:14:27 -04:00
John Howard
c162cdb15f Windows: Native console disableNewlineAutoReturn
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-03-24 15:37:47 -07:00
Brian Goff
baac2f4867 Fix panic in loading plugins
When a plugin is first found, it is loaded into the available plugins
even though it's not activated yet.
If activation fails it is taken out of the list.
While it is in the list, other callers may see it and try to check it's
manifest. If it is not fully activated yet, the manifest will be nil and
cause a panic.

This is especially problematic for drivers that are down and have not
been activated yet.

We could just not load the plugin into the available list until it's
fully active, however that will just cause multiple of the same plugin
to attemp to be loaded.

We could check if the manifest is nil and return early (instead of
panicing on a nil manifest), but this will cause a 2nd caller to receive
a response while the first caller is still waiting, which can be
awkward.

This change uses a condition variable to handle activation (instead of
sync.Once). If the plugin is not activated, callers will all wait until
it is activated and receive a broadcast from the condition variable
signaling that it's ok to proceed, in which case we'll check if their
was an error in activation and proceed accordingly.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-23 15:34:15 -04:00
Aleksa Sarai
75a271603c pkg: archive: don't fail Untar if xattrs are not supported
Since certain filesystems don't support extended attributes, ignore
errors produced (emitting a warning) when attempting to apply extended
attributes to file.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-03-24 02:05:36 +11:00
John Howard
bb68b666c5 Windows: Fix mountinfo
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-03-21 22:03:24 -07:00
Antonio Murdaca
5008a34072 Merge pull request #21333 from cpuguy83/sigpipe
Don't forward SIGPIPE from client to container
2016-03-21 15:09:13 +01:00
Jess Frazelle
b77573f48e Merge pull request #21274 from jfrazelle/fix-variables-that-werent-being-used
fix variables that werent being called
2016-03-18 18:03:15 -07:00
Brian Goff
131c59193f Merge pull request #21325 from frenkel/openbsd-support
Support OpenBSD build
2016-03-18 20:53:17 -04:00
Brian Goff
81707de23f Don't forward SIGPIPE from client to container
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-18 16:50:18 -04: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
Frank Groeneveld
719a43ca35 Cli binary can now be build on OpenBSD
Signed-off-by: Frank Groeneveld <frank@frankgroeneveld.nl>
2016-03-18 14:56:21 +01:00
Jessica Frazelle
0e025b4bb1
fix variables that werent being called
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-03-17 13:19:55 -07:00
Alexander Morozov
41c1c6501e Merge pull request #21266 from estesp/dockremap-system-user
Change subordinate range-owning user to be a system user
2016-03-17 11:42:15 -07:00
Antonio Murdaca
ae1002219b pkg: truncindex: provide more info in error
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-17 15:53:12 +01:00
Phil Estes
c18e7f3a04 Change subordinate range-owning user to be a system user
Change user/group creation to use flags to adduser/useradd to enforce it
being a system user. Use system user defaults that auto-create a
matching group. These changes allow us to remove all group creation
code, and in doing so we also removed the code that finds available uid,
gid integers and use post-creation query to gather the system-generated
uid and gid.

The only added complexity is that today distros don't auto-create
subordinate ID ranges for a new ID if it is a system ID, so we now need
to handle finding a free range and then calling the `usermod` tool to
add the ranges for that ID. Note that this requires the distro supports
the `-v` and `-w` flags on `usermod` for subordinate ID range additions.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2016-03-16 18:44:10 -04:00
Antonio Murdaca
f0d83c4cdb *: fix response body leaks
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-16 17:15:42 +01:00
Amit Krishnan
a9c6169138 Remove flush(stdout) in pkg/chrootarchive/diff_unix.go and improve error reporting of flush() to fix #21103
pkg/chrootarchive/diff_unix.go erroneously calls flush on stdout, which tries to read from stdout returning an error.
This has been fixed by removing the call and by modifying flush to return errors and checking for these errors on calls to flush.

Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
2016-03-15 10:29:51 -07:00
David Calavera
6f2d8b411e Merge pull request #21162 from estesp/copyastar-dir-create
Fix CopyWithTar creation of new destination dir as remapped root
2016-03-15 10:26:30 -07:00
Yong Tang
d17bb23ae6 Fix flaky test TestJSONFormatProgress (#21124)
In TestJSONFormatProgress, the progress string was used for comparison.
However, the progress string (progress.String()) uses time.Now().UTC()
to generate the timeLeftBox which is not a fixed value and cannot be
compared reliably.

This PR fixes the issue by stripping the timeLeftBox field before doing
the comparison.

This PR fixes #21124.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-03-14 16:00:12 +00:00
Phil Estes
06d95003b3 Fix CopyWithTar creation of new destination dir as remapped root
If the destination does not exist, it needs to be created with ownership
mapping to the remapped uid/gid ranges if user namespaces are enabled.
This fixes ADD operations, similar to the prior fixes for COPY and WORKDIR.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2016-03-12 23:05:45 -05:00
allencloud
bbeb859b64 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-03-11 23:22:16 +08:00
Jessica Frazelle
69cf03700f
pids limit support
update bash commpletion for pids limit

update check config for kernel

add docs for pids limit

add pids stats

add stats to docker client

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-03-08 07:55:01 -08:00
Brian Goff
c08b674d56 Merge pull request #20843 from calavera/plugin_any_transport
Call plugins with custom transports.
2016-03-04 11:59:32 -05:00
Vincent Demeester
9bc62e6031 Merge pull request #20872 from duglin/Issue20470
Optimize .dockerignore when there are exclusions
2016-03-04 09:45:19 +01:00
David Calavera
b7bc1ce1a4 Merge pull request #20730 from clnperez/sysinfo-match-ip-case
Match case for IP variables in sysinfo pkg
2016-03-03 08:48:57 -08:00
Doug Davis
842b8d8784 Optimize .dockerignore when there are exclusions
Closes #20470

Before this PR we used to scan the entire build context when there were
exclusions in the .dockerignore file (paths that started with !). Now we
only traverse into subdirs when one of the exclusions starts with that dir
path.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-03-03 05:46:24 -08:00
Sebastiaan van Stijn
174959e8bf Merge pull request #20896 from Microsoft/jjh/unit-pkg-integration
Windows CI: Turn off failing unit tests pkg\integration
2016-03-03 10:41:21 +01:00
Sebastiaan van Stijn
df1941bf0e Merge pull request #20894 from Microsoft/jjh/unit-pkg-graphdb
Windows CI: Turn off failing unit tests pkg\graphdb
2016-03-03 10:40:22 +01:00
John Howard
5f2ba2b9ba Windows CI: Turn off failing unit tests pkg\integration
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-03-02 19:37:18 -08:00
John Howard
9f5984d93f Windows CI: Turn off failing unit tests pkg\graphdb
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-03-02 19:27:41 -08:00
John Howard
3e78ad7be2 Windows CI: Turn off failing unit test pkg\fileutils
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-03-02 19:05:33 -08:00