Commit graph

30830 commits

Author SHA1 Message Date
Alexander Morozov
70dc4cd446 Merge pull request #30719 from alfred-landrum/gdcounter
Fix RefCounter count return
2017-02-03 11:09:17 -08:00
Harald Albers
013152972d Refactor use of shared completion functions
Signed-off-by: Harald Albers <github@albersweb.de>
2017-02-03 18:01:32 +01:00
Alfred Landrum
874a502b1d
Fix RefCounter count return
Signed-off-by: Alfred Landrum <alfred.landrum@docker.com>
2017-02-03 08:47:55 -08:00
allencloud
98ffe52fbc update incorrect comments of CheckpointList
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-04 00:41:35 +08:00
Harald Albers
a45ab91066 Add bash completion for dockerd --default-shm-size
Signed-off-by: Harald Albers <github@albersweb.de>
2017-02-03 17:39:32 +01:00
Harald Albers
6f86066d44 Add bash completion for {stack services,service ls} --format
Signed-off-by: Harald Albers <github@albersweb.de>
2017-02-03 13:09:46 +01:00
Ian Campbell
a4f71ccff6 Wrap output of docker cli --help
This should go some way to unblocking a solution to #18797, #18385 etc by
removing the current rather restrictive constraints on help text length.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-02-03 11:05:49 +00:00
Ian Campbell
a6e536e415 Revendor github.com/spf13/pflag to 9ff6c6923cfffbcd502984b8e0c80539a94968b7
$ git log --oneline dabebe21bf79..9ff6c6923cff
9ff6c69 Add FlagSet.FlagUsagesWrapped(cols) which wraps to the given column (#105)
a9a634f Add BoolSlice and UintSlice flag types. (#111)
a232f6d Merge pull request #102 from bogem/redundant
5126803 Merge pull request #110 from hardikbagdi/master
230dccf add badges to README.md
c431975 Merge pull request #107 from xilabao/add-user-supplied-func-when-parse
271ea0e Make command line parsing available outside pflag
25f8b5b Merge pull request #109 from SinghamXiao/master
1fcda0c too many arguments
5ccb023 Remove Go 1.5 from Travis
86d3545 Clean up code

I am interested in 9ff6c69 for a followup.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-02-03 11:05:49 +00:00
Victor Vieux
c3b660b112 Merge pull request #30654 from Microsoft/jjh/unifyworkdir
Windows: Unify workdir handling
2017-02-03 00:37:54 -08:00
allencloud
75f7305888 add status code 404 for plugin api endpoint enable and disable
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-03 15:13:10 +08:00
Madhu Venugopal
f388b7aa8a List Networks need not pull all the endpoints
Pulling all the endpoints is a very resource heavy operation especially
for Global-scoped networks with a backing KVStore. Such heavy operations
can be fetched for individual network inspect. These are unneccessary
for a simple network list operation.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-02-02 20:19:58 -08:00
Tibor Vass
edd977db97 Merge pull request #30685 from Microsoft/jjh/commandLine
Windows: Remove unused commandLine
2017-02-02 16:06:31 -08:00
Alessandro Boch
1e98350ab4 Revert "Fix IT case for network name validation"
This reverts commit 9cebccfb95.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-02 15:38:12 -08:00
Alessandro Boch
9e555ce7c3 Vendoring libnetwork @802895f
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-02 15:22:26 -08:00
Mark Parker
b7d802bbcc Add NILVALUE for STRUCTURED-DATA in RFC5424 logs
RFC 5424 (https://tools.ietf.org/html/rfc5424#section-6.2) requires that
STRUCTURED-DATA be present, either as NILVALUE (-) or as one or more
SD-ELEMENT items. Because Docker doesn't ever create any SD-ELEMENT items,
the format should output the NILVALUE instead. This resolves parsing issues
in various RFC 5424-compliant syslog servers.

Signed-off-by: Mark Parker <godefroi@gmail.com>
2017-02-02 15:16:14 -07:00
Anusha Ragunathan
26517a0161 Add Windows specific exec root for plugins.
Fixes #30572

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-02-02 14:00:12 -08:00
Sebastiaan van Stijn
e07c392c49 Merge pull request #30180 from allencloud/add-endpoint-mode-a-default-value
add endpoint mode a default value
2017-02-02 11:51:44 -08:00
Alexander Morozov
12b8432413 Merge pull request #30644 from Microsoft/jjh/makecheckgoversion
Windows: make.ps1 validate go version
2017-02-02 11:39:56 -08:00
John Howard
f42033ba94 Windows: Unify workdir handling
Signed-off-by: John Howard <jhoward@microsoft.com>

Working directory processing was handled differently for Hyper-V and Windows-Server containers, as annotated in the builder documentation (updated in this PR). For Hyper-V containers, the working directory set by WORKDIR was not created. This PR makes Hyper-V containers work the same as Windows Server containers (and the same as Linux).

Example (only applies to Hyper-V containers, so not reproducible under CI environment)
Dockerfile:
FROM microsoft/nanoserver
WORKDIR c:\installer
ENV GOROOT=c:\installer
ADD go.exe .
RUN go --help
Running on Windows Server 2016, using docker master without this change, but with daemon set to --exec-opt isolation=hyperv as it would be for Client operating systems.
PS E:\go\src\github.com\docker\docker> dockerd -g c:\control --exec-opt isolation=hyperv
time="2017-02-01T15:48:09.657286100-08:00" level=info msg="Windows default isolation mode: hyperv"
time="2017-02-01T15:48:09.662720900-08:00" level=info msg="[graphdriver] using prior storage driver: windowsfilter"
time="2017-02-01T15:48:10.011588000-08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2017-02-01T15:48:10.016655800-08:00" level=info msg="Loading containers: start."
time="2017-02-01T15:48:10.460820000-08:00" level=info msg="Loading containers: done."
time="2017-02-01T15:48:10.509859600-08:00" level=info msg="Daemon has completed initialization"
time="2017-02-01T15:48:10.509859600-08:00" level=info msg="Docker daemon" commit=3c64061 graphdriver=windowsfilter version=1.14.0-dev
First with no explicit isolation:
PS E:\docker\build\unifyworkdir> docker build --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 7e0f41d08204
Removing intermediate container 236c7802042a
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in 8ea5237183c1
 ---> 394b70435261
Removing intermediate container 8ea5237183c1
Step 4/5 : ADD go.exe .
 ---> e47401a1745c
Removing intermediate container 88dcc28e74b1
Step 5/5 : RUN go --help
 ---> Running in efe90e1b6b8b
container efe90e1b6b8b76586abc5c1dc0e2797b75adc26517c48733d90651e767c8463b encountered an error during CreateProcess: failure in a Windows system call: The directory name is invalid. (0x10b) extra info: {"ApplicationName":"","CommandLine":"cmd /S /C go --help","User":"","WorkingDirectory":"C:\\installer","Environment":{"GOROOT":"c:\\installer"},"EmulateConsole":false,"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}
PS E:\docker\build\unifyworkdir>
Then forcing process isolation:
PS E:\docker\build\unifyworkdir> docker build --isolation=process --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 350c955980c8
Removing intermediate container 8339c1e9250c
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in bde511c5e3e0
 ---> b8820063b5b6
Removing intermediate container bde511c5e3e0
Step 4/5 : ADD go.exe .
 ---> e4ac32f8902b
Removing intermediate container d586e8492eda
Step 5/5 : RUN go --help
 ---> Running in 9e1aa235af5f
Cannot mkdir: C:\installer is not a directory
PS E:\docker\build\unifyworkdir>
Now compare the same results after this PR. Again, first with no explicit isolation (defaulting to Hyper-V containers as that's what the daemon it set to) - note it now succeeds 😄
PS E:\docker\build\unifyworkdir> docker build --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 4f319f301c69
Removing intermediate container 61b9c0b1ff6f
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in c464a1d612d8
 ---> 96a26ab9a7b5
Removing intermediate container c464a1d612d8
Step 4/5 : ADD go.exe .
 ---> 0290d61faf57
Removing intermediate container dc5a085fffe3
Step 5/5 : RUN go --help
 ---> Running in 60bd56042ff8
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

The command 'cmd /S /C go --help' returned a non-zero code: 2
And the same with forcing process isolation. Also works 😄
PS E:\docker\build\unifyworkdir> docker build --isolation=process --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> f423b9cc3e78
Removing intermediate container 41330c88893d
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in 0b99a2d7bf19
 ---> e051144bf8ec
Removing intermediate container 0b99a2d7bf19
Step 4/5 : ADD go.exe .
 ---> 7072e32b7c37
Removing intermediate container a7a97aa37fd1
Step 5/5 : RUN go --help
 ---> Running in 7097438a54e5
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

The command 'cmd /S /C go --help' returned a non-zero code: 2
PS E:\docker\build\unifyworkdir>
2017-02-02 11:25:07 -08:00
John Howard
b7106a92f2 Windows: Remove unused commandLine
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-02 11:16:11 -08:00
Kenfe-Mickaël Laventure
de26546680 Merge pull request #30668 from albers/completion-log-opt-ringbuffer
Add bash completion for `{dockerd,docker run} --log-opt max-buffer-size|mode`
2017-02-02 08:47:03 -08:00
Harald Albers
5d9acc2e61 Add bash completion for {dockerd,docker run} --log-opt max-buffer-size|mode
Signed-off-by: Harald Albers <github@albersweb.de>
2017-02-02 17:29:35 +01:00
Vincent Demeester
31f1ff029f Merge pull request #30653 from vipconsult/28766-fix-checkpoint-ls-error-messages
more descriptive error for checkpoint ls  for non existent containers
2017-02-02 14:41:53 +01:00
Vincent Demeester
ada44345dd Merge pull request #30040 from Microsoft/jjh/ntauthority
Windows: Test for run as local system
2017-02-02 12:13:55 +01:00
Vincent Demeester
8ed8366efd Merge pull request #29896 from Microsoft/jjh/gofmt
Windows: gofmt checker fixes
2017-02-02 12:12:57 +01:00
Vincent Demeester
c6a3ed39f5 Merge pull request #30645 from yongtang/02012017-man-plugin-ls
Add markdown for man page of `docker plugin ls`
2017-02-02 10:42:31 +01:00
Vincent Demeester
4ca00c09b6 Merge pull request #28199 from yongtang/11062016-service-ls-format
Add `--format` to `docker service ls`
2017-02-02 10:40:04 +01:00
Sebastiaan van Stijn
1caba6c71e Merge pull request #30660 from yongtang/02012017-man-container
Make markdown for man pages of `docker container ...` consistent
2017-02-01 23:15:12 -08:00
Sebastiaan van Stijn
32697b57c8 Merge pull request #30663 from Mashimiao/reference-cmdline-service-tfix
reference/commandline: small tfix
2017-02-01 22:23:08 -08:00
Ma Shimiao
31f63d64e3 reference/commandline: small tfix
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-02 13:54:45 +08:00
Phil Estes
f0089a85ec Merge pull request #30460 from yongtang/28176-attach-binary-frame-websocket
Use binary frame for websocket attach endpoint
2017-02-01 20:02:46 -08:00
John Howard
a08e1304d4 Windows: gofmt check write out right filename
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-01 19:13:33 -08:00
John Howard
ffbe4b6ff1 Windows: Test for run as local system
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-01 18:37:44 -08:00
Yong Tang
6c27237f76 Make markdown for man pages of docker container ... consistent
This fix updates the markdown for man pages of `docker container ...`
so that they are consistent. The changes are based on feedback:
https://github.com/docker/docker/pull/30645#discussion_r99020188
https://github.com/docker/docker/pull/30645#discussion_r99020304

1. Use `H2 (##)` as needed
2. Use unrpiviledged prompt (`$`) instead of (`#`)

This PR convers files under man/src/container/*.md

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-01 18:34:55 -08:00
Yong Tang
8ee9c635b2 Add markdown for man page of docker plugin ls
This fix adds markdown for man page of `docker plugin ls`,
based on https://github.com/docker/docker/pull/28627#issuecomment-276731752

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-01 18:28:16 -08:00
Brian Goff
bb0a532fc2 Merge pull request #30203 from allencloud/validate-healthcheck-params-in-daemon-side
validate healthcheck params in daemon side
2017-02-01 21:19:30 -05:00
Victor Vieux
632c8dd4cf Merge pull request #30616 from thaJeztah/fix-yakkety-install
install dirmngr if needed
2017-02-01 17:21:21 -08:00
Krasi Georgiev
8ddfd2f759 more descriptive error fo checkpoint ls for non existent containers
Signed-off-by: Krasi Georgiev <krasi@vip-consult.solutions>
2017-02-02 00:42:29 +02:00
Vincent Demeester
3c64061b67 Merge pull request #29747 from xlgao-zju/break-the-for
exit collect when we get EOF
2017-02-01 22:29:18 +01:00
Alexander Morozov
dc20f2abd4 Merge pull request #28762 from cpuguy83/logger_ring_buffer
Implement optional ring buffer for container logs
2017-02-01 13:04:01 -08:00
Alexander Morozov
3138a8f9f2 Merge pull request #30643 from dnephin/fix-stack-remove-test-flake
Add missing build tag for stack tests
2017-02-01 12:31:02 -08:00
Sebastiaan van Stijn
f5263c8074
install dirmngr if needed
as of Ubuntu Yakkety, dirmngr is now in a separate
package (see https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1634464)

this patch updates the install script to install
the dirmngr package if it's not installed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-01 12:17:23 -08:00
Alexander Morozov
39f717ac89 Merge pull request #30444 from albers/completion-checkpoints
Add bash completion for `docker checkpoint`
2017-02-01 11:44:37 -08:00
Alexander Morozov
f9998c8c9f Merge pull request #30613 from mattmoor/track-elided-pulls
Add tracking to elided layer pulls.
2017-02-01 11:38:35 -08:00
Brian Goff
3f4fccb65f Use sync.Pool for logger Messages
This reduces allocs and bytes used per log entry significantly as well
as some improvement to time per log operation.

Each log driver, however, must put messages back in the pool once they
are finished with the message.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-01 13:52:37 -05:00
Brian Goff
054abff3b6 Implement optional ring buffer for container logs
This allows the user to set a logging mode to "blocking" (default), or
"non-blocking", which uses the ring buffer as a proxy to the real log
driver.

This allows a container to never be blocked on stdio at the cost of
dropping log messages.

Introduces 2 new log-opts that works for all drivers, `log-mode` and
`log-size`. `log-mode` takes a  value of "blocking", or "non-blocking"
I chose not to implement this as a bool since it is difficult to
determine if the mode was set to false vs just not set... especially
difficult when merging the default daemon config with the container config.
`log-size` takes a size string, e.g. `2MB`, which sets the max size
of the ring buffer. When the max size is reached, it will start
dropping log messages.

```
BenchmarkRingLoggerThroughputNoReceiver-8           	2000000000	        36.2 ns/op	 856.35 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputWithReceiverDelay0-8   	300000000	       156 ns/op	 198.48 MB/s	      32 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay1-8        	2000000000	        36.1 ns/op	 857.80 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay10-8       	1000000000	        36.2 ns/op	 856.53 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay50-8       	2000000000	        34.7 ns/op	 894.65 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay100-8      	2000000000	        35.1 ns/op	 883.91 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay300-8      	1000000000	        35.9 ns/op	 863.90 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay500-8      	2000000000	        35.8 ns/op	 866.88 MB/s	       0 B/op	       0 allocs/op
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-01 13:52:37 -05:00
John Howard
5e7a9e523f Windows: make.ps1 validate go version
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-01 10:31:27 -08:00
Alexander Morozov
dc78b3a1d4 Merge pull request #29863 from ncdc/journald-logdriver-drain-one-more-time-after-follow-ends
journald logs: drain 1 more time at container exit
2017-02-01 10:30:14 -08:00
Daniel Nephin
dd1d35c269 Add missing build tag for stack tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-02-01 13:25:37 -05:00
Harald Albers
f8456192ab Improve bash completion for docker plugin enable|disable
Signed-off-by: Harald Albers <github@albersweb.de>
2017-02-01 19:18:32 +01:00