Commit Graph

204 Commits

Author SHA1 Message Date
eefbd135ae Remove solaris build tag and `contrib/mkimage/solaris
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4785f1a7ab7ec857dc3ca849ee6ecadf519ef30e
Component: engine
2017-11-02 00:01:46 +00:00
d78181e968 Remove solaris files
For obvious reasons that it is not really supported now.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 5a9b5f10cf967f31f0856871ad08f9a0286b4a46
Component: engine
2017-10-24 15:39:34 -04:00
74a0738e87 Merge pull request #35253 from Microsoft/jjh/startuplogging
Windows: Fix startup logging
Upstream-commit: 2058854c4b118b28abe638befbb98320526da902
Component: engine
2017-10-23 18:43:41 +02:00
044d7f995b Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ddae20c032058a0fd42c34c2e9750ee8f6296ac8
Component: engine
2017-10-20 07:11:37 -07:00
d03ac8e017 Fix startup logging
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7d0dea10557e01865d67aa90c43b294fa6b36c42
Component: engine
2017-10-19 11:09:29 -07:00
35db73fa01 LCOW: API: Add platform to /images/create and /build
Signed-off-by: John Howard <jhoward@microsoft.com>

This PR has the API changes described in https://github.com/moby/moby/issues/34617.
Specifically, it adds an HTTP header "X-Requested-Platform" which is a JSON-encoded
OCI Image-spec `Platform` structure.

In addition, it renames (almost all) uses of a string variable platform (and associated)
methods/functions to os. This makes it much clearer to disambiguate with the swarm
"platform" which is really os/arch. This is a stepping stone to getting the daemon towards
fully multi-platform/arch-aware, and makes it clear when "operating system" is being
referred to rather than "platform" which is misleadingly used - sometimes in the swarm
meaning, but more often as just the operating system.
Upstream-commit: 0380fbff37922cadf294851b1546f4c212c7f364
Component: engine
2017-10-06 11:44:18 -07:00
101f740d40 Move RFC3339NanoFixed to a more appropriate package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 27cfa68af16721c978803c3b695bcc7181ccc721
Component: engine
2017-09-25 16:07:24 -04:00
1cc36398f9 Merge pull request #34495 from ripcurld0/registry_mirror_json
Exit if service config is loaded unsuccessfully on startup
Upstream-commit: b075cd2d78c1bafcded7d12ddb2e7c215e2e5117
Component: engine
2017-09-18 21:59:14 -07:00
5681a2921d Exit if service config is loaded unsuccessfully on startup
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 5258297dac1e32c8dd1caff528d321ac7eb4a87c
Component: engine
2017-09-17 18:50:16 +03:00
a641c1b7f0 Add LCOW behind experimental,
might not be the cleanest way, but it's definitly the way with the
minimum code change.

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: ff686743c50dc34b57f5627ba6fee38502bdd3ec
Component: engine
2017-09-14 13:51:16 -07:00
803b5f0e94 Merge pull request #34821 from thaJeztah/remove-enable-api-cors
Remove deprecated --enable-api-cors flag
Upstream-commit: dc35a8a5d22b6c828cd105be7c62b72919df25cd
Component: engine
2017-09-13 20:10:27 -07:00
18c29c5c5f Add gosimple linter
Update gometalinter

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f7f101d57ef8cbf2d8723a18b7d723c5c5dd04b6
Component: engine
2017-09-12 12:09:59 -04:00
3e4a18de4d Remove deprecated --enable-api-cors flag
The `--enable-api-cors` flag was deprecated in f3dd2db4ff7de1399a49af928cd3eae4fccf8764,
and marked for removal in docker 17.09 through 85f92ef3590b386ea17e3948262725a2d3ce4db5.

This patch removes the deprecated flag.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7d4eab554379524c2421a7ecd3319d1d087d1de2
Component: engine
2017-09-12 12:43:34 +02:00
8ef302a435 Merge pull request #34625 from dnephin/more-linters
Add interfacer and unconvert linters
Upstream-commit: cb952bf00695b3429476f59c5534a9c604c6f010
Component: engine
2017-09-01 08:46:08 -07:00
f77a5de38d Remove command line flag install from registry package.
Settings flags is the responsibility of the application (cmd/) not a library

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 73ec0ff86b06925e63016c0948be3a49cf8915b4
Component: engine
2017-08-29 15:55:09 -04:00
9cb0439501 Move ErrorContains to an internal package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e62b2d410cda6ac9166ac8d052fd3fb99a9460bf
Component: engine
2017-08-25 12:04:58 -04:00
8ae7aa2322 Merge pull request #34583 from tklauser/win-event-functions
Use windows event functions from golang.org/x/sys/windows
Upstream-commit: 2cea2f5469871c16564c900c5b27cee102ebff0b
Component: engine
2017-08-25 07:43:03 -07:00
157456237a Add interfacer linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 709bf8b7bcc67f3ea3a7a39e29af8ae16a38b06f
Component: engine
2017-08-24 15:08:26 -04:00
b03ce80e95 Update tests to use gotestyourself/fs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 60672382c7eb1f65e063c4bf07b0880559cea91b
Component: engine
2017-08-23 17:25:00 -04:00
94c685a721 Add deadcode linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 62c1f0ef41e6cd88a8846da1c11976a320ca8b41
Component: engine
2017-08-21 18:18:50 -04:00
6b3b192846 Add goimports to linters.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 372670b5074b077927314cdf46af30f8752e7db0
Component: engine
2017-08-21 18:15:08 -04:00
4f846a2e15 Use event functions from golang.org/x/sys/windows
Use CreateEvent, OpenEvent (which both map to the respective *EventW
function) and PulseEvent from golang.org/x/sys instead of local copies.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: e942513ac46656c3f54cd103e990e2b7bd5c2b14
Component: engine
2017-08-21 12:58:09 +02:00
de626e10fb Fix golint errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9b47b7b1519c5f2138e2933fb1fc459eb00895c0
Component: engine
2017-08-18 14:23:44 -04:00
eca24fb7b0 Implement none, private, and shareable ipc modes
Since the commit d88fe447df0e8 ("Add support for sharing /dev/shm/ and
/dev/mqueue between containers") container's /dev/shm is mounted on the
host first, then bind-mounted inside the container. This is done that
way in order to be able to share this container's IPC namespace
(and the /dev/shm mount point) with another container.

Unfortunately, this functionality breaks container checkpoint/restore
(even if IPC is not shared). Since /dev/shm is an external mount, its
contents is not saved by `criu checkpoint`, and so upon restore any
application that tries to access data under /dev/shm is severily
disappointed (which usually results in a fatal crash).

This commit solves the issue by introducing new IPC modes for containers
(in addition to 'host' and 'container:ID'). The new modes are:

 - 'shareable':	enables sharing this container's IPC with others
		(this used to be the implicit default);

 - 'private':	disables sharing this container's IPC.

In 'private' mode, container's /dev/shm is truly mounted inside the
container, without any bind-mounting from the host, which solves the
issue.

While at it, let's also implement 'none' mode. The motivation, as
eloquently put by Justin Cormack, is:

> I wondered a while back about having a none shm mode, as currently it is
> not possible to have a totally unwriteable container as there is always
> a /dev/shm writeable mount. It is a bit of a niche case (and clearly
> should never be allowed to be daemon default) but it would be trivial to
> add now so maybe we should...

...so here's yet yet another mode:

 - 'none':	no /dev/shm mount inside the container (though it still
		has its own private IPC namespace).

Now, to ultimately solve the abovementioned checkpoint/restore issue, we'd
need to make 'private' the default mode, but unfortunately it breaks the
backward compatibility. So, let's make the default container IPC mode
per-daemon configurable (with the built-in default set to 'shareable'
for now). The default can be changed either via a daemon CLI option
(--default-shm-mode) or a daemon.json configuration file parameter
of the same name.

Note one can only set either 'shareable' or 'private' IPC modes as a
daemon default (i.e. in this context 'host', 'container', or 'none'
do not make much sense).

Some other changes this patch introduces are:

1. A mount for /dev/shm is added to default OCI Linux spec.

2. IpcMode.Valid() is simplified to remove duplicated code that parsed
   'container:ID' form. Note the old version used to check that ID does
   not contain a semicolon -- this is no longer the case (tests are
   modified accordingly). The motivation is we should either do a
   proper check for container ID validity, or don't check it at all
   (since it is checked in other places anyway). I chose the latter.

3. IpcMode.Container() is modified to not return container ID if the
   mode value does not start with "container:", unifying the check to
   be the same as in IpcMode.IsContainer().

3. IPC mode unit tests (runconfig/hostconfig_test.go) are modified
   to add checks for newly added values.

[v2: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-51345997]
[v3: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-53902833]
[v4: addressed the case of upgrading from older daemon, in this case
     container.HostConfig.IpcMode is unset and this is valid]
[v5: document old and new IpcMode values in api/swagger.yaml]
[v6: add the 'none' mode, changelog entry to docs/api/version-history.md]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7120976d74195a60334c688a061270a4d95f9aeb
Component: engine
2017-08-14 10:50:39 +03:00
1b1bfe0449 Move pkg/listeners away
It is only used in `daemon` and should really live there.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c204fce2ee926417d1dc7d10c043a81b93d2a72b
Component: engine
2017-08-08 18:14:04 +02:00
65cd1af516 Merge pull request #34371 from Microsoft/jjh/logrustimestamp
logrus use full timestamp
Upstream-commit: cb9128677f29a1e4d7ff2a74efc9cc7bcdf0169b
Component: engine
2017-08-04 07:25:59 -07:00
8f436ab301 logrus use full timestamp
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: af64e396cadb90e5177d0601b4869ba98e17c0d7
Component: engine
2017-08-02 10:30:30 -07:00
688ebf06fb Remove the logrus from pkg/signal
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: cc4da8112814cdbb00dbf23370f9ed764383de1f
Component: engine
2017-08-02 18:15:25 +08:00
d659edcaf5 Update logrus to v1.0.1
Fixes case sensitivity issue

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 1009e6a40b295187e038b67e184e9c0384d95538
Component: engine
2017-07-31 13:16:46 -07:00
d027c213aa Merge pull request #34304 from tiborvass/use-buildkit-session
Use buildkit session package
Upstream-commit: 1375d893e9fb2213df8dbb4d375a220e9b009025
Component: engine
2017-07-31 11:16:27 -07:00
7deeee36b6 Remove client/session package, depend on buildkit's session package
gofmt -w -r '"github.com/docker/docker/client/session" -> "github.com/moby/buildkit/session"'
gofmt -w -r '"github.com/docker/docker/client/session/filesync" -> "github.com/moby/buildkit/session/filesync"'

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 41445a4745451b99d1c361c6c87447da790cb01b
Component: engine
2017-07-28 16:34:23 -07:00
c202b3f97f Allow to set the control plane MTU
Add daemon config to allow the user to specify the MTU of the control plane network.
The first user of this new parameter is actually libnetwork that can seed the
gossip with the proper MTU value allowing to pack multiple messages per UDP packet sent.
If the value is not specified or is lower than 1500 the logic will set it to the default.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: f9f25ca5e44c89d7c1ebdfa9865076eb2cde9bb2
Component: engine
2017-07-28 13:52:03 -07:00
8f5aa8e137 Merge pull request #33440 from RenaudWasTaken/genericresource
Added support for Generic Resources
Upstream-commit: 9319a8a2dd5760b3d0eda359b8c3872f5e37aa87
Component: engine
2017-07-25 15:32:25 -04:00
2029cf1c2d Added support for Generic Resources
Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
Upstream-commit: 87e1464c438f4163e2694a0bf29ae5a45903449b
Component: engine
2017-07-24 17:49:56 -07:00
1549d1d8d9 Enable pprof/debug endpoints by default
Makes sure that debug endpoints are always available, which will aid in
debugging demon issues.

Wraps debug endpoints in the middleware chain so the can be blocked by
authz.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 408c7ade7008ca9b2181e12e51a01250a7a94413
Component: engine
2017-07-17 15:01:30 -04:00
520019f676 Windows: fix build after re-vendoring golang.org/x/sys
Due to the CL https://go-review.googlesource.com/c/39608/ in
x/sys/windows which changed the definitions of STD_INPUT_HANDLE,
STD_OUTPUT_HANDLE and STD_ERROR_HANDLE, we get the following failure
in cmd/dockerd/service_windows.go after re-vendoring x/sys/windows:

  06:29:57 # github.com/docker/docker/cmd/dockerd
  06:29:57 .\service_windows.go:400: cannot use sh (type int) as type uint32 in argument to windows.GetStdHandle

Fix it by adding an explicit type conversion when calling
windows.GetStdHandle.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: e769da88e6c6e94a397822dd8962cbcb83a402a0
Component: engine
2017-07-12 14:52:42 +02:00
e95f4619cd [project] change syscall to /x/sys/unix|windows
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 069fdc8a083cb1663e4f86fe3fd9b9a1aebc3e54
Component: engine
2017-07-11 08:00:32 -04:00
c782cb6c44 Make plugin emit strongly typed, consumable events
Enables other subsystems to watch actions for a plugin(s).

This will be used specifically for implementing plugins on swarm where a
swarm controller needs to watch the state of a plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 72c3bcf2a533a827402945e3a55872e2db4fb024
Component: engine
2017-07-06 14:26:06 -04:00
908bb4d956 Improve routes initialization
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 8f68adfaf0231ded0ba6bd2ec522711752031885
Component: engine
2017-06-22 11:52:43 -07:00
e529bcd027 Implement incremental file sync using client session
Also exposes shared cache and garbage collection/prune
for the source data.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 5c3d2d552b0430672d5f481ab2d37036f6e92166
Component: engine
2017-06-22 11:52:35 -07:00
b1e4d7d884 Add long-running client session endpoint
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ec7b6238c31e26702ecf366731532e189b5da142
Component: engine
2017-06-22 11:22:41 -07:00
3af9801344 LCOW: Move daemon stores to per platform
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3aa4a0071536d3b106374eaa44d8a55765901aa6
Component: engine
2017-06-20 19:49:52 -07:00
7ded95d08c LCOW: Deprecate storagedriver option
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 01e597ca4351b83e32346c32ad510f03b0b3b95b
Component: engine
2017-06-20 09:21:37 -07:00
cad0e361c3 LCOW: Add environment variable to enable
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: fe5b34ba8828dc2f2f7db180a102cee360fec6e0
Component: engine
2017-06-20 08:55:46 -07:00
8c7c972d20 Merge pull request #33454 from dnephin/refactor-builder-remove-copy-on-build
[Builder] Move file coping from the daemon to the builder
Upstream-commit: 99c72eb2682c0539ad3cc544eb28876af78b33a1
Component: engine
2017-06-20 10:12:57 +02:00
ead60478b8 add NamedUlimitOpt implement NamedOption to fix 32528
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 148f2711e8e78c9cf43b4c30b03b33b16d9e7098
Component: engine
2017-06-16 10:14:09 +08:00
af2183c2c4 Disable legacy (v1) registries by default
Deprecation of interacting with v1 registries was
started in docker 1.8.3, which added a `--disable-legacy-registry`
flag.

This option was anounced to be the default starting
with docker 17.06, and v1 registries completely
removed in docker 17.12.

This patch updates the default, and disables
interaction with v1 registres by default.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 128280013f2ad90520c97b47a787be0db883e870
Component: engine
2017-06-12 11:04:28 +02:00
13d2adae3f Fix copy when used with scratch and images with empty RootFS
Commit the rwLayer to get the correct DiffID
Refacator copy in thebuilder
move more code into exportImage
cleanup some windows tests
Release the newly commited layer.
Set the imageID on the buildStage after exporting a new image.
Move archiver to BuildManager.
Have ReleaseableLayer.Commit return a layer
and store the Image from exportImage in the local imageSources cache
Remove NewChild from image interface.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 51360965206b0db49cc0365dabb590063a17a9df
Component: engine
2017-06-08 15:07:16 -04:00
91bac6c3f8 Merge pull request #33330 from coolljt0725/fix_sock_is_dir
Don't create source directory while the daemon is being shutdown, fix #30348
Upstream-commit: cd2255a296acf8408d2afb65b897560479f1ecd3
Component: engine
2017-06-07 12:37:08 +09:00
1fd0a9619a Remove cli/flags package
- Moving the `common*.go` files in `cmd/dockerd` directly (it's the
  only place it's getting used)
- Rename `cli/flags` to `cli/config` because it's the only thing left
  in that package 👼

Now, `integration-cli` does *truly* not depend on `cobra` stuff.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9ff9a91ab7f964f4e5042f94fe22dd50b5c3d832
Component: engine
2017-06-01 13:34:31 -07:00