Commit Graph

762 Commits

Author SHA1 Message Date
d7084e8097 Merge pull request #35638 from cpuguy83/error_helpers2
Add helpers to create errdef errors
Upstream-commit: c36274da8326c59aaa12c48196671b41dcb89e5b
Component: engine
2018-01-15 10:56:46 -08:00
621388138c Golint: remove redundant ifs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b4a63139696aea2c73ec361a9af8b36a118f0423
Component: engine
2018-01-15 00:42:25 +01:00
d4d0b5c268 Move api/errdefs to errdefs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d453fe35b9b8b52d0677fe0c3cc8373f2f5d30d0
Component: engine
2018-01-11 21:21:43 -05:00
952c29f8da Add helpers to create errdef errors
Instead of having to create a bunch of custom error types that are doing
nothing but wrapping another error in sub-packages, use a common helper
to create errors of the requested type.

e.g. instead of re-implementing this over and over:

```go
type notFoundError struct {
  cause error
}

func(e notFoundError) Error() string {
  return e.cause.Error()
}

func(e notFoundError) NotFound() {}

func(e notFoundError) Cause() error {
  return e.cause
}
```

Packages can instead just do:

```
  errdefs.NotFound(err)
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 87a12421a94faac294079bebc97c8abb4180dde5
Component: engine
2018-01-11 21:21:43 -05:00
3887b15050 Merge pull request #35925 from Microsoft/jjh/builder-default-rw-size-bump
Windows: Bump RW layer size
Upstream-commit: fff423289965260c0ca83024059aa30999792c4a
Component: engine
2018-01-04 22:54:38 -08:00
e76ddf0d7b Merge pull request #35737 from tonistiigi/fix-git-submodules
gitutils: fix checking out submodules
Upstream-commit: 50ce54645094a5d337e5d841c037663e9f4e3170
Component: engine
2018-01-05 10:41:04 +08:00
fb52c2003b Windows: Bump RW layer size
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: deb335d04fd47e96fdb7b342dece513174b574bd
Component: engine
2018-01-03 15:59:06 -08:00
2af5d43021 Fix environ substitutions in docker commit --change ...
The building machinery was being handed an uninitialized container
Config.  This changes it to use the target container's Config.

Resolves #30538

Signed-off-by: Anthony Sottile <asottile@umich.edu>
Upstream-commit: 0785836c4b440a8d4a5dfdb8df82e50f9f4d23a1
Component: engine
2017-12-20 11:03:38 -08:00
5b48c4106b gitutils: remove checkout directory on error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4ea320cb8ef71c2fc9ee391e2e8be915ba99b17e
Component: engine
2017-12-08 11:58:13 -08:00
94fbfde561 gitutils: fix checking out submodules
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a6025255246aab21426a51986b7d138a14d9ac90
Component: engine
2017-12-07 14:25:19 -08:00
94ae8f10c7 Change references from test-integration-cli to test-integration
Signed-off-by: Anthony Sottile <asottile@umich.edu>
Upstream-commit: b6eed3dca2e57705cb75895cad0b5337c79686d9
Component: engine
2017-11-27 19:01:14 -08:00
8771152e42 Merge pull request #35429 from dnephin/build-fails-on-long-label
Fix dockerfile parser failing silently on long tokens
Upstream-commit: 7c53e732530642f817c83e1ad303f8f9f7018def
Component: engine
2017-11-15 18:48:50 +01:00
60d1b81b0d Add deepCopyRunConfig for copying buidler runConfig
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9bcd5d2574fe0c84542d2fa18232c34e2a9c0cac
Component: engine
2017-11-13 14:51:17 -05:00
84fe2b7d9a Fix remote build target as Dockerfile
The test was passing previously because the preamble was already buffered. After
the change to return Scanner.Err() the final read error on the buffer was no
longer being ignored.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a74cc833450dfc48cc95b2b109cbcb24feff4929
Component: engine
2017-11-09 15:05:26 -05:00
ca892e4f1a Fix dockerfile parser failing silently on long tokens
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 59ad3a36e2684bd36a4b02179949bd17f1406918
Component: engine
2017-11-09 15:03:20 -05:00
7cfb40e0bf Set OS on scratch image and prevent panic if empty
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: a97817b673cbd3bfaf6e752282c4992ac43ff594
Component: engine
2017-11-06 18:22:15 -08:00
63e16f39ad Merge pull request #35244 from joyce/joyce/todo-fixes
fix todo for printing error messages
Upstream-commit: 48694a3f880650a1b41765ab0bebb373d0b73a22
Component: engine
2017-11-04 13:52:45 -07:00
b9b2e53e40 builder: fix long stream sync
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: c6703b722e1c0914342d61ca6af77aea93150873
Component: engine
2017-11-03 12:53:17 -07:00
6edab5bbbd fix todo for printing error messages
Signed-off-by: Joyce <mail@joycejang.com>
Upstream-commit: 883ab41ce8f5163ba8ce0450ffff1e63c266f23b
Component: engine
2017-11-03 11:35:41 -07:00
b1394ae4a5 Merge pull request #34271 from tonistiigi/build-symlink-hash
builder: fix build cache hash for broken symlink
Upstream-commit: 3ab20a87fa10360df891a67b8307399cdf1ab429
Component: engine
2017-10-31 09:38:57 -07: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
d91c638398 Typo fixed and simple code.
Signed-off-by: Ri Xu <xuri@360.net>
Upstream-commit: 87e8a936e82ecfbef59b829d8bbfca3fb4aa3163
Component: engine
2017-10-18 10:26:58 +08:00
817827c1bc Test & Fix build with rm/force-rm matrix
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 172e73a1dfb894c54fdc93fa6ef338eb1374d06c
Component: engine
2017-10-12 10:22:40 +02:00
a2e7813d7e Fix tests after Hash() behavior change
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: d5b15f0d3ee6b9575a919ca5ba568631957425e0
Component: engine
2017-10-10 14:23:12 -07:00
0772688cf2 Merge pull request #35138 from vdemeester/foo
Carry 35078 : Fix TestErrorCases to run all tests
Upstream-commit: 513f0e6c26cfac31d41a1eb249758907950cb7be
Component: engine
2017-10-09 12:16:16 -07:00
4d1cde4541 Fix TestErrorCases to run all tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d2c41f06c36dc24b2170fef365563d64cc5bd8ec
Component: engine
2017-10-09 15:15:58 +02:00
3d973055bf LCOW: API change JSON header to string POST parameter
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d98ecf2d6cdad7dae65868398440cfdc855e5263
Component: engine
2017-10-06 15:26:48 -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
5103c6279f builder: fix build cache hash for broken symlink
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 793ebdbf4b187b3680aed0073643040ddbeef523
Component: engine
2017-09-29 09:27:51 -07:00
4034b44eca Cleaning dead code out of the builder
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Upstream-commit: dff2a23749a6b7c949146d7850f514cd74e3a8d7
Component: engine
2017-09-29 02:55:35 +02:00
f6d296e26e Warn on empty continuation lines only, not for comments
Commit 8d1ae76dcbbb73d8e20c6a14a7d3fe2410b95f55 added
deprecation warnings for empty continuation lines,
but also treated comment-only lines as empty.

This patch distinguishes empty continuation lines
from comment-only lines, and only outputs warnings
for the former.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2fd736ac10c1c46d1001373d887cb99b3d8ee824
Component: engine
2017-09-28 00:11:10 +02:00
6424aeb9fa Merge pull request #34918 from thaJeztah/update-copy-add-error
Improve error message for COPY missing destination
Upstream-commit: 76b5ab6f43aeffe4261e2b1f848476d36d332880
Component: engine
2017-09-26 18:43:36 +02:00
0c54b3a041 Improve error message for COPY missing destination
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5d05a8291314b8f727b04b504b8d7fc7ed7f42da
Component: engine
2017-09-25 14:17:18 +02:00
afac6be123 builder: updates to session after vendor
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: d4729749023fde0c57cded0c8159dc85cd7ee448
Component: engine
2017-09-22 09:51:52 -07:00
e01e198f54 Introduce a typed command system and 2 phase parse/dispatch build
This is a work base to introduce more features like build time
dockerfile optimisations, dependency analysis and parallel build, as
well as a first step to go from a dispatch-inline process to a
frontend+backend process.

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 669c0677980b04bcbf871bb7c2d9f07caccfd42b
Component: engine
2017-09-18 09:48:56 +02:00
cddfe04f6a LCOW: Implemented support for docker cp + build
This enables docker cp and ADD/COPY docker build support for LCOW.
Originally, the graphdriver.Get() interface returned a local path
to the container root filesystem. This does not work for LCOW, so
the Get() method now returns an interface that LCOW implements to
support copying to and from the container.

Signed-off-by: Akash Gupta <akagup@microsoft.com>
Upstream-commit: 7a7357dae1bcccb17e9b2d4c7c8f5c025fce56ca
Component: engine
2017-09-14 12:07:52 -07:00
b3c31e9800 Add unit test to cover changes.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 027297a60f5f5a70e1e3eb3a68280f64c66bc877
Component: engine
2017-09-14 16:17:38 +00:00
ac38bbaf63 Fix build with ADD urls without any sub path
This fix tries to address the issue raised in #34208 where
in Dockerfile an `ADD` followed by an url without any sub path
will cause an error.

The issue is because the temporary filename relies on the sub path.

An integration test has been added.

This fix fixes #34208.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: bea0a072d86604071c99e9b6989b19ca4fe22032
Component: engine
2017-09-14 16:17:38 +00: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
fdd3e06a77 Add ineffassign linter
Also enable GC in linting to reduce memory usage.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 09652bf8789142a5a5a1de2d41590300761b4954
Component: engine
2017-09-08 18:23:21 -04: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
ef16add9bb Merge pull request #34263 from estesp/chown-flag-add-copy
Add --chown flag to ADD/COPY commands
Upstream-commit: a1183dda578f531ef65766611f9e16a0636e3a17
Component: engine
2017-08-28 09:50:44 -07: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
01392057b0 Add unconvert linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2f5f0af3fdb7e9ee607a0e178dbe2af6e10cccf4
Component: engine
2017-08-24 15:08:31 -04: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
eec82cc7b5 Merge pull request #34600 from dnephin/remove-pkg-testutil
Remove pkg/testutil/utils.go
Upstream-commit: 59e1565565071da160a0ad3781335e4f974f93f8
Component: engine
2017-08-23 09:38:20 -07:00
b680839840 *: normalize the use of normalize
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: ae8dbeaeedce3a9f247f2d58df7459f9d79bde5d
Component: engine
2017-08-22 15:25:31 -07:00
56e5cffbc1 Remove testutil.ReadBody
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f304e72a2e4451b043ab1a73a6c44894333c5c7
Component: engine
2017-08-22 17:15:26 -04:00
f14f410ab3 Rebase --chown function for ADD/COPY
Rebases and completes initial PR for (prior: --user) --chown flag for
ADD/COPY commands in Dockerfile.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 19a29f6fcf8354732cface3c656c3a3070230dcb
Component: engine
2017-08-22 13:39:25 -04:00