Commit Graph

239 Commits

Author SHA1 Message Date
455cc50b83 Include Endpoint List for Shared Endpoints
Do not allow sharing of container network with hyperv containers

Signed-off-by: Madhan Raj Mookkandy <madhanm@microsoft.com>
Upstream-commit: 349913ce9fde34d8acd08fad5ce866401f4d135e
Component: engine
2017-07-06 12:19:17 -07:00
643654c2f0 Spelling fixes
* additional
* ambiguous
* anonymous
* anything
* application
* because
* before
* building
* capabilities
* circumstances
* commit
* committer
* compresses
* concatenated
* config
* container
* container's
* current
* definition
* delimiter
* disassociates
* discovery
* distributed
* doesnotexist
* downloads
* duplicates
* either
* enhancing
* enumerate
* escapable
* exactly
* expect
* expectations
* expected
* explicitly
* false
* filesystem
* following
* forbidden
* git with
* healthcheck
* ignore
* independent
* inheritance
* investigating
* irrelevant
* it
* logging
* looking
* membership
* mimic
* minimum
* modify
* mountpoint
* multiline
* notifier
* outputting
* outside
* overridden
* override
* parsable
* plugins
* precedence
* propagation
* provided
* provides
* registries
* repositories
* returning
* settings
* should
* signals
* someone
* something
* specifically
* successfully
* synchronize
* they've
* thinking
* uninitialized
* unintentionally
* unmarshaling
* unnamed
* unreferenced
* verify

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 39bcaee47b8a284a46b761afe218ba7deda0d482
Component: engine
2017-07-03 13:13:09 -07:00
f8f582f303 Set unpasued state when receiving 'stateExit' event
Description:
 1. start a container with restart=always.
    `docker run -d --restart=always ubuntu sleep 3`
 2. container init process exits.
 3. use `docker pause <id>` to pause this container.

if the pause action is before cgroup data is removed and after the init process died.
`Pause` operation will success to write cgroup data, but actually do not freeze any process.

And then docker received pause event and stateExit event from
containerd, the docker state will be Running(paused), but the container
is free running.

Then we can not remove it, stop it , pause it  and unpause it.

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
Upstream-commit: fe1b4cfba6320793373c5397641d743d9fe94cf8
Component: engine
2017-07-03 17:26:13 +08:00
96548baff2 Merge pull request #33882 from aaronlehmann/memdb-no-container
container: Handle failed memdb lookups
Upstream-commit: 18d874a20fccbd017e91cfaad31861b0953e22fa
Component: engine
2017-06-30 14:31:10 -04:00
60185c5eb3 container: Handle failed memdb lookups
If a container doesn't exist in the memdb, First will return nil, not an
error. This should be checked for before using the result.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: c26b0cdfd1a026af88fcfbed9d3c3acdd6d171a0
Component: engine
2017-06-29 16:33:30 -07:00
9a5747b3f9 LCOW: Fix nits from 33241
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4ec9766a27ffb964cec6b8b2745725965b2644aa
Component: engine
2017-06-27 11:59:49 -07:00
69f8ddc123 ensure heath monitor status updates are propagated
initHealthMonitor and updateHealthMonitor can cause container state to
be changed (State.Health).

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: 04bd768a889f94a4dc6ad25e2a014dffd0a4e04e
Component: engine
2017-06-23 07:52:34 -07:00
9755d1918d avoid re-reading json files when copying containers
Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: a43be3431e51b914ab170569b9e58239d64b199c
Component: engine
2017-06-23 07:52:34 -07:00
b8affe908f only Daemon.load needs to call label.ReserveLabel
Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: 9134e87afc6f3215a58d23c7261242b764357501
Component: engine
2017-06-23 07:52:33 -07:00
940ce3d71d save deep copies of Container in the replica store
Reuse existing structures and rely on json serialization to deep copy
Container objects.

Also consolidate all "save" operations on container.CheckpointTo, which
now both saves a serialized json to disk, and replicates state to the
ACID in-memory store.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: edad52707c536116363031002e6633e3fec16af5
Component: engine
2017-06-23 07:52:33 -07:00
666b1f6a5b no need to save container state here
it is already being saved (with a lock held) on the subsequent
operations.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: f668af4475980e32c99503c4a513668c24ea2da6
Component: engine
2017-06-23 07:52:33 -07:00
84bdea3f4f how to maintain the container snapshot struct
Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: 2ed6f9257a0ccb81583e65bf8af0e00f8e2dedcb
Component: engine
2017-06-23 07:52:32 -07:00
ae145558ae Move checkpointing to the Container object
Also hide ViewDB behind an inteface.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: aacddda89df05b88a6d15fb33c42864760385ab2
Component: engine
2017-06-23 07:52:32 -07:00
8889d56b70 keep a consistent view of containers rendered
Replicate relevant mutations to the in-memory ACID store. Readers will
then be able to query container state without locking.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: eed4c7b73f0cf98cf48943da1c082f3210b28c82
Component: engine
2017-06-23 07:52:31 -07:00
ad08f8c7af in-memory ACID store for containers
This can be used by readers/queries so they don't need locks.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: 054728b1f555892c6c0bfd7abfbaeb2fedbc8f10
Component: engine
2017-06-23 07:24:11 -07:00
8cedd0fee9 Move platform specific mount data to Container
The Solaris version (previously daemon/inspect_solaris.go) was
apparently missing some fields that should be available on that
platform.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: cfc404a375817125e4b32a9cd6a4ec7e3c55dc4e
Component: engine
2017-06-23 07:22:47 -07:00
01b491fce5 LCOW: Create layer folders with correct ACL
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ed10ac6ee93cf5c389a735c0c97b08d5d5dff3a9
Component: engine
2017-06-20 19:50:12 -07:00
94ce604e3d LCOW: OCI Spec and Environment for container start
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f1545882264e743fa6d6859ee8687407e28fc35c
Component: engine
2017-06-20 19:50:11 -07:00
767c3943b7 LCOW: Add platform to container, init on FromDisk()
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f97fbba5cec3d27099e230f7c1dc278c54180d74
Component: engine
2017-06-20 19:49:51 -07:00
dd6f4eb487 LCOW: Remove CommonContainer - just Container
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 55f8828eec1ff6c70628a0b6f22bea175ce36159
Component: engine
2017-06-20 08:55:46 -07:00
0db82d1f6c Don't chown/chmod volumes if not needed.
Doing a chown/chmod automatically can cause `EPERM` in some cases (e.g.
with an NFS mount). Currently Docker will always call chown+chmod on a
volume path unless `:nocopy` is passed in, but we don't need to make
these calls if the perms and ownership already match and potentially
avoid an uneccessary `EPERM`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f05a023760493dbd41fbfc1bb76ad334b579e94e
Component: engine
2017-06-18 16:44:52 -07:00
11c8449db6 container/stream/attach: use pools.Copy
The use of pools.Copy avoids io.Copy's internal buffer allocation.
This commit replaces io.Copy with pools.Copy to avoid the allocation of
buffers in io.Copy.

Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 014095e6a07748d0e1ce2f759f5c4f4b3783e765
Component: engine
2017-06-10 21:13:33 +03:00
5d87b0ddc9 Remove unused functions from archive.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 967ef7e6d2bd88a5d7010863f3d7138ca61b1939
Component: engine
2017-06-07 11:44:33 -04:00
779caabedf Partial refactor of UID/GID usage to use a unified struct.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 09cd96c5ad2de369912cdf708c3c50f41e4586ac
Component: engine
2017-06-07 11:44:33 -04:00
02f992f2b8 Fix Typos: continer,contianer -> container
Signed-off-by: Chen Min <chenmin46@huawei.com>
Upstream-commit: 2b62eb434be4770c101ef79666a952fd7f43a742
Component: engine
2017-06-01 19:21:01 +08:00
6fa6566523 Merge pull request #33329 from wenjianhn/EINVAL
Don't log EINVAL when unmount IPC
Upstream-commit: 41c3c9cc866d0e310664e2c4cbd42f0df1b88efa
Component: engine
2017-05-31 11:17:19 -07:00
8e156ee521 Don't warn if the shm or mquere is not mounted
Fix #33328

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
Upstream-commit: cfa2591d3f2636221e5005b3609aeb572e0c6653
Component: engine
2017-05-31 16:19:59 +08:00
4bffda81c9 Improve description of Running and Paused booleans
Commit abd72d4008dde7ee8249170d49eb4bc963c51e24 added
a "FIXME" comment to the container "State", mentioning
that a container cannot be both "Running" and "Paused".

This comment was incorrect, because containers on
Linux actually _must_ be running in order to be
paused.

This patch adds additional information both in a
comment, and in the API documentation to clarify
that these booleans are not mutually exclusive.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b654b6244d6d63a0758029488a95feb446e089bd
Component: engine
2017-05-19 12:29:54 +02:00
cee45f7710 Adding network specific options to service create/update
The commit adds capability to accept csv parameters
for network option in service create/update commands.The change
includes name,alias driver options specific to the network.
With this the following will be supported

docker service create --name web --network name=docknet,alias=web1,driver-opt=field1=value1 nginx
docker service create --name web --network docknet nginx
docker service update web --network-add name=docknet,alias=web1,driver-opt=field1=value1
docker service update web --network-rm docknet

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
Upstream-commit: fe11de01772ec7c7501d3b679ce94d41bcc14060
Component: engine
2017-05-17 18:46:34 -07:00
6f26254653 Merge pull request #32237 from jlhawn/update_container_wait
Update Container Wait
Upstream-commit: c053a2069e1c8e99488517071540fb3e526233f3
Component: engine
2017-05-17 02:39:52 +02:00
fa44d02011 Update ContainerWait API
This patch adds the untilRemoved option to the ContainerWait API which
allows the client to wait until the container is not only exited but
also removed.

This patch also adds some more CLI integration tests for waiting for a
created container and waiting with the new --until-removed flag.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Handle detach sequence in CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Update Container Wait Conditions

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Apply container wait changes to API 1.30

The set of changes to the containerWait API missed the cut for the
Docker 17.05 release (API version 1.29). This patch bumps the version
checks to use 1.30 instead.

This patch also makes a minor update to a testfile which was added to
the builder/dockerfile package.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Remove wait changes from CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address minor nits on wait changes

- Changed the name of the tty Proxy wrapper to `escapeProxy`
- Removed the unnecessary Error() method on container.State
- Fixes a typo in comment (repeated word)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Use router.WithCancel in the containerWait handler

This handler previously added this functionality manually but now uses
the existing wrapper which does it for us.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Add WaitCondition constants to api/types/container

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

- Update ContainerWait backend interface to not return pointer values
  for container.StateStatus type.
- Updated container state's Wait() method comments to clarify that a
  context MUST be used for cancelling the request, setting timeouts,
  and to avoid goroutine leaks.
- Removed unnecessary buffering when making channels in the client's
  ContainerWait methods.
- Renamed result and error channels in client's ContainerWait methods
  to clarify that only a single result or error value would be sent
  on the channel.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Move container.WaitCondition type to separate file

... to avoid conflict with swagger-generated code for API response

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 4921171587c09d0fcd8086a62a25813332f44112
Component: engine
2017-05-16 15:11:39 -07:00
3f22cbeb2a Update Container Wait Backend
This patch consolidates the two WaitStop and WaitWithContext methods
on the container.State type. Now there is a single method, Wait, which
takes a context and a bool specifying whether to wait for not just a
container exit but also removal.

The behavior has been changed slightly so that a wait call during a
Created state will not return immediately but instead wait for the
container to be started and then exited.

The interface has been changed to no longer block, but instead returns
a channel on which the caller can receive a *StateStatus value which
indicates the ExitCode or an error if there was one (like a context
timeout or state transition error).

These changes have been propagated through the rest of the deamon to
preserve all other existing behavior.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: cfdf84d5d04c8ee656e5c4ad3db993c258e52674
Component: engine
2017-05-16 15:09:14 -07:00
0f00ae4912 Add Windows configs support
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: e0d533b1e8a8dd62ed6dff2dfda3c3220e0474b9
Component: engine
2017-05-16 14:25:32 -07:00
a52518e2ab Add Windows secrets support
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: bd4e8aa64e5e7dedb60ca6670d7ddb32d5af0db9
Component: engine
2017-05-16 11:30:06 -07:00
efc30370d8 Add config support to executor backend
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 9e9fc7b57c1764c008e568ed52bcd1aade7eb40c
Component: engine
2017-05-11 10:08:21 -07:00
675654a603 Use "local" secret paths based on the secretID
This prevents targets with the same basename from colliding.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 37ce91ddd60e50a8bcd7ac3a7ba858f94c28c51e
Component: engine
2017-05-10 10:23:09 -07:00
4764bfe1f6 support custom paths for secrets
This adds support to specify custom container paths for secrets.

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 67d282a5c95ca1d25cd4e9c688e89191f662d448
Component: engine
2017-05-10 10:23:07 -07:00
25ad1db09f Merge pull request #32909 from cpuguy83/32907_volume_unmount_on_cp
Add refcount for MountPoint
Upstream-commit: 09ff5ce29c82b6c97123b24855e1ef11e860b47a
Component: engine
2017-05-09 20:15:41 +02:00
ce01ee60c2 Add refcount for MountPoint
This makes sure that multiple users of MountPoint pointer can
mount/unmount without affecting each other.

Before this PR, if you run a container (stay running), then do `docker
cp`, when the `docker cp` is done the MountPoint is mutated such that
when the container stops the volume driver will not get an Unmount
request. Effectively there would be two mounts with only one unmount.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: df0d317a64e4a74433359e826bc1d606e050a5ed
Component: engine
2017-04-28 16:01:25 -04:00
9432bd8249 Switch to using opencontainers/selinux for selinux bindings
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: abbbf914986d6d0ea15923f9a57a99465791bc83
Component: engine
2017-04-24 21:29:47 +02:00
ba4f1c70ab Add --cpus support for docker update
This fix tries to address the issue raised in 31032 where it was
not possible to specify `--cpus` for `docker update`.

This fix adds `--cpus` support for `docker update`. In case both
`--cpus` and `--cpu-period/--cpu-quota` have been specified,
an error will be returned.

Related docs has been updated.

Integration tests have been added.

This fix fixes 31032.

This fix is related to 27921, 27958.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 61022436926a8d0c92068e8116a2ad77f43eb6d6
Component: engine
2017-04-06 15:40:12 -07:00
2fe955c1d1 Merge pull request #31634 from AkihiroSuda/clarify-env-without-value
api: clarify that Env var without `=` is removed from the environment
Upstream-commit: 9f9cc221bdb0a919d6ed28bdfaffa9ae2fe3a5fd
Component: engine
2017-03-31 17:34:32 +02:00
173cafe0e6 api: clarify that Env var without = is removed from the environment
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 1921fad6f516a1d45e18054745eb1d2b03aaf665
Component: engine
2017-03-08 04:27:25 +00:00
8032897023 Add missing resources to update block for Windows containers
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: e507066303b527cbbd3e7c076460f50af4c841d5
Component: engine
2017-03-07 16:25:17 -08:00
00f7fe38c2 Merge pull request #30807 from chchliang/networkproject
Check parameter --ip --ip6 --link-local-ip in `docker network connect`
Upstream-commit: de5ca681b5aa170d8e486b7a2a3a144fc032ed70
Component: engine
2017-03-06 21:11:55 +01:00
709434a772 (*) Support --net:container:<containername/id> for windows
(*) (vdemeester) Removed duplicate code across Windows and Unix wrt Net:Containers
(*) Return unsupported error for network sharing for hyperv isolation containers

Signed-off-by: Madhan Raj Mookkandy <MadhanRaj.Mookkandy@microsoft.com>
Upstream-commit: 040afcce8f3f54c64d328929c5115128f623deb1
Component: engine
2017-02-28 20:03:43 -08:00
72ef392909 Check parameter --ip --ip6 --link-local-ip in
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: b7ce6ce02e2776c3d83eac7c676cc10e23908c78
Component: engine
2017-02-23 14:13:55 +08:00
cfc078d90b Merge pull request #30654 from Microsoft/jjh/unifyworkdir
Windows: Unify workdir handling
Upstream-commit: c3b660b112804dfb1752efc1368a104897c7b884
Component: engine
2017-02-03 00:37:54 -08:00
bb87b715d8 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>
Upstream-commit: f42033ba9484ab31611bb1e4a0416beb3aa956da
Component: engine
2017-02-02 11:25:07 -08:00
11a6f80b8b 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>
Upstream-commit: 054abff3b67bb5d66323e5418a43c845a3eac8a1
Component: engine
2017-02-01 13:52:37 -05:00