Commit graph

5122 commits

Author SHA1 Message Date
Sebastiaan van Stijn
8b1adf55c2 Merge pull request #33471 from Snorch/sysconf-nrprocessors-onln-errno
Do not treat C.sysconf(C._SC_NPROCESSORS_ONLN) non-zero errno as error
2017-06-06 10:22:41 +02:00
Daniel Nephin
4060d6ee0b Remove the last of pkg/httputil
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-02 16:54:36 -04:00
Victor Vieux
2445e6b99d move multireader out of /pkg
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-06-01 16:22:00 -07:00
Sebastiaan van Stijn
872e28bb14 Merge pull request #33335 from cpuguy83/33334_check_unset_sig
Check signal is unset before using user stopsignal
2017-06-01 23:10:16 +02:00
Pavel Tikhomirov
dec084962e Do not treat C.sysconf(C._SC_NPROCESSORS_ONLN) non-zero errno as error
Treat return code -1 as error instead.

People from glibc say that errno is undefined in case of successful
sysconf call according to POSIX standard:
Glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21536

More over in sysconf man it is wrongly said that "errno is not changed"
on success. So I've created a bug to man-pages:
https://bugzilla.kernel.org/show_bug.cgi?id=195955

Background: Glibc's sysconf(_SC_NPROCESSORS_ONLN) changes errno to
ENOENT, if there is no /sys/devices/system/cpu/online file, while
the call itself is successful. In Virtuozzo containers we prohibit
most of sysfs files for security reasons. So we have Run():daemon
/stats/collector.go infinitely loop never actualy collecting stats
from publisher pairs.

v2: add comment

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2017-06-01 18:23:49 +03:00
Sebastiaan van Stijn
316681cd2a Merge pull request #33305 from thaJeztah/suppress-logger-close-error
Don't log error if file is already closed
2017-05-31 17:09:09 +02:00
Kenfe-Mickaël Laventure
7c2f20107a Merge pull request #33249 from ripcurld0/env_validate
Add container environment variables correctly to the health check
2017-05-31 07:35:28 -07:00
Brian Goff
114652ab86 Check signal is unset before using user stopsignal
This fixes an issue where if a stop signal is set, and a user sends
SIGKILL, `container.ExitOnNext()` is not set, thus causing the container
to restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-05-30 13:04:36 -04:00
Vincent Demeester
6629f1d0e7 Merge pull request #33360 from aaronlehmann/vendor-swarmkit-7e096ced
Vendor swarmkit 7e096ced
2017-05-30 09:59:48 -07:00
Sebastiaan van Stijn
4bf8714fac Merge pull request #33311 from msabansal/dnssearch
Adding support for DNS search on RS1
2017-05-30 13:09:18 +02:00
Sebastiaan van Stijn
07b51ed300 Don't log error if file is already closed
When closing the log-file, and the file is already
closed, there's no need to log an error.

This patch adds a `closed` boolean to check if the
file was closed, and if so, skip closing the file.
This prevents errors like this being logged:

    level=error msg="Error closing logger: invalid argument"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-05-29 17:42:37 +02:00
Sebastiaan van Stijn
79b19c2e16 Merge pull request #33257 from mtesselH/master
Add CreatedAt filed to volume. Display when volume is inspected.
2017-05-29 10:48:07 +01:00
Alfred Landrum
32da2a4234
prevent image prune panic
Signed-off-by: Alfred Landrum <alfred.landrum@docker.com>
2017-05-26 12:54:39 -07:00
Marianna
a46f757c40 Add CreatedAt filed to volume. Display when volume is inspected.
Closes #32663 by adding CreatedAt field when volume is created.
Displaying CreatedAt value when volume is inspected
Adding tests to verfiy the new field is correctly populated

Signed-off-by: Marianna <mtesselh@gmail.com>

Moving CreatedAt tests from the CLI

Moving the tests added for the newly added CreatedAt field for Volume, from CLI to API tests

Signed-off-by: Marianna <mtesselh@gmail.com>
2017-05-26 11:47:02 -07:00
Vincent Demeester
e925820bfd Merge pull request #33384 from Microsoft/jjh/sandboxpath
Windows: Remove unused SandboxPath
2017-05-25 11:21:15 -07:00
Aaron Lehmann
da3c3ec145 Merge pull request #33292 from keloyang/attach-restart-check
Add a restarting check to ContainerAttach
2017-05-24 18:30:05 -07:00
John Howard
2f038c2586 Windows: Remove unused SandboxPath
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-24 13:44:35 -07:00
Aaron Lehmann
10df99f9ae Vendor swarmkit 7e096ced
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-05-23 15:01:35 -07:00
Ying Li
bf3e9293a6 Do not clear swarm directory at the begining of swarm init and swarm join now.
However, do clear the directory if init or join fails, because we don't
want to leave it in a half-finished state.

Signed-off-by: Ying Li <ying.li@docker.com>
2017-05-22 17:45:20 -07:00
Kenfe-Mickaël Laventure
bb64d45be1 Merge pull request #32774 from darrenstahlmsft/ProcessorMaximum
Use CpuMaximum instead of CpuPercent for more precision
2017-05-22 08:55:17 -07:00
Boaz Shuster
5836d86ac4 Add container environment variables correctly to the health check
The health check process doesn't have all the environment
varialbes in the container or has them set incorrectly.

This patch should fix that problem.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-05-21 21:39:00 +03:00
yangshukui
5010e09534 Add a restarting check to ContainerAttach
Signed-off-by: yangshukui <yangshukui@huawei.com>
2017-05-20 11:27:45 +08:00
Evan Hazlett
8eeba75198
remove RuntimeData from cluster and types
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-05-19 17:10:32 -04:00
Darren Stahl
425973cbb8 Use CpuMaximum instead of CpuPercent for more precision
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-05-19 12:33:14 -07:00
Brian Goff
39a604c0d4 Merge pull request #33286 from aboch/ingr
Properly identify ingress network created with older swarm
2017-05-19 10:04:29 -04:00
yupengzte
49bf533fe7 arg filt
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
2017-05-19 13:47:32 +08:00
Alessandro Boch
93763f11ee Properly identify ingress network created with older swarm
- otherwise docker network prune will remove it

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-18 19:47:45 -07:00
Sandeep Bansal
b8e8dcd6e0 Adding support for DNS search on RS1
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-05-18 19:41:06 -07:00
Sebastiaan van Stijn
01af41ed99 Merge pull request #33281 from dmcgowan/overlay2-on-btrfs
Support overlay2 on btrfs
2017-05-19 03:09:39 +02:00
Derek McGowan
f64a4ad008
Support overlay2 on btrfs
OverlayFS is supported on top of btrfs as of Linux Kernel 4.7.
Skip the hard enforcement when on kernel 4.7 or newer and
respect the kernel check override flag on older kernels.
https://btrfs.wiki.kernel.org/index.php/Changelog#By_feature

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-05-18 15:26:03 -07:00
Sebastiaan van Stijn
6b26257202 Merge pull request #33250 from cyphar/apparmor-readonly-root-fix
apparmor: make pkg/aaparser work on read-only root
2017-05-18 23:17:31 +02:00
Kenfe-Mickaël Laventure
cc24049f77 Merge pull request #33264 from wenjianhn/chkp-ls
Fix checkpoint ls
2017-05-18 13:37:42 -07:00
YAMASAKI Masahide
524f306340 Improved poor memory efficiency of awslogs
Signed-off-by: YAMASAKI Masahide <masahide.y@gmail.com>
2017-05-18 23:30:00 +09:00
Jacob Wen
c0d2ec1eb5 Fix checkpoint ls
Use create=false when calling getCheckpointDir
Fix #33263

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
2017-05-18 10:57:10 +08:00
Abhinandan Prativadi
fe11de0177 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>
2017-05-17 18:46:34 -07:00
Alessandro Boch
b34d3e730f Integrate local datascope network with swarm
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-17 15:50:28 -07:00
Alessandro Boch
fcafc7108b Allow to control network scope
- User can now promote a network's scope to swarm,
  so that the network is visible to swarm

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-17 15:50:28 -07:00
Alessandro Boch
9ee7b4dda9 Support configuration networks
- They are configuration-only networks which
  can be used to supply the configuration
  when creating regular networks.
- They do not get allocated and do net get plumbed.
  Drivers do not get to know about them.
- They can be removed, once no other network is
  using them.
- When user creates a network specifying a
  configuration network for the config, no
  other network specific configuration field
  is are accepted. User can only specify
  network operator fields (attachable, internal,...)

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-17 15:50:28 -07:00
Dong Chen
59d45c384a support cluster events
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2017-05-17 11:46:30 -07:00
Aleksa Sarai
dd340c52cb
apparmor: make pkg/aaparser work on read-only root
This is necessary because normally `apparmor_parser -r` will try to
create a temporary directory on the host (which is not allowed if the
host has a rootfs). However, the -K option bypasses saving things to the
cache (which avoids this issue).

  % apparmor_parser -r /tmp/docker-profile
  mkstemp: Read-only file system
  % apparmor_parser -Kr /tmp/docker-profile
  %

In addition, add extra information to the ensureDefaultAppArmorProfile
errors so that problems like this are easier to debug.

Fixes: 2f7596aaef ("apparmor: do not save profile to /etc/apparmor.d")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-05-18 00:05:13 +10:00
Brian Goff
4dd3e5b77c Merge pull request #33075 from x1022as/stop
fix inconsistent state string with containerd
2017-05-17 09:27:47 -04:00
Brian Goff
5034288381 Merge pull request #30891 from mixja/awslogs-multiline-support
Add awslogs multiline support
2017-05-17 09:27:21 -04:00
Sebastiaan van Stijn
c053a2069e Merge pull request #32237 from jlhawn/update_container_wait
Update Container Wait
2017-05-17 02:39:52 +02:00
Sebastiaan van Stijn
a30ef99e8d Merge pull request #33151 from nwt/push-foreign-layers
Add daemon option to push foreign layers
2017-05-17 02:04:31 +02:00
John Stephens
7658851e74 Merge pull request #33169 from johnstep/windows-configs
Add Windows configs support
2017-05-16 16:46:34 -07:00
Tibor Vass
d6f4fe9e38 Merge pull request #32388 from nishanttotla/pin-by-digest-on-client-alternative
Moving docker service digest pinning to client side
2017-05-16 15:24:07 -07:00
Josh Hawn
4921171587 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)
2017-05-16 15:11:39 -07:00
Josh Hawn
cfdf84d5d0 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)
2017-05-16 15:09:14 -07:00
Noah Treuhaft
67fdf574d5 Add daemon option to push foreign layers
The --allow-nondistributable-artifacts daemon option specifies
registries to which foreign layers should be pushed.  (By default,
foreign layers are not pushed to registries.)

Additionally, to make this option effective, foreign layers are now
pulled from the registry if possible, falling back to the URLs in the
image manifest otherwise.

This option is useful when pushing images containing foreign layers to a
registry on an air-gapped network so hosts on that network can pull the
images without connecting to another server.

Signed-off-by: Noah Treuhaft <noah.treuhaft@docker.com>
2017-05-16 14:36:36 -07:00
John Stephens
e0d533b1e8
Add Windows configs support
Signed-off-by: John Stephens <johnstep@docker.com>
2017-05-16 14:25:32 -07:00