Commit Graph

329 Commits

Author SHA1 Message Date
4dda269d8d Fix cancel build doesn't remove the intermediate container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 9392de9dfefc851139146161aa322e6c9e74cacf
Component: engine
2015-10-16 05:18:10 -04:00
647970c93e refactor use of container struct from daemon
- use Exists instead of Get
 - push Get inside of daemonbuilder

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 844fb2961976d1bca52cc8560abf6b1ac2ae754a
Component: engine
2015-10-12 16:20:55 -07:00
f800251e5f Add useful info to builder cache logrus.Debug
Closes: #16790

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 4920d4009330365babd228e6c27e317a672edc87
Component: engine
2015-10-10 05:53:06 -07:00
2e11eb0e71 Windows: Regression re-fix builder
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9cd84e405d970239df7169e66a099e28311ef614
Component: engine
2015-10-07 15:57:37 -07:00
d8db4defa7 Abstract builder and implement server-side dockerfile builder
This patch creates interfaces in builder/ for building Docker images.
It is a first step in a series of patches to remove the daemon
dependency on builder and later allow a client-side Dockerfile builder
as well as potential builder plugins.

It is needed because we cannot remove the /build API endpoint, so we
need to keep the server-side Dockerfile builder, but we also want to
reuse the same Dockerfile parser and evaluator for both server-side and
client-side.

builder/dockerfile/ and api/server/builder.go contain implementations
of those interfaces as a refactoring of the current code.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: e0ef11a4c2c6789e08b61df082b5b9aa70898e7a
Component: engine
2015-10-06 19:10:19 -04:00
5d2ec8fed8 Move builder files to builder/dockerfile
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f41230b93a77ca7f4d84718f39a4847b6117f694
Component: engine
2015-10-05 18:26:47 -04:00
d911d85df7 Merge pull request #16490 from Microsoft/10662-mtimefix
Fixed file modified time not changing on windows
Upstream-commit: 134fefbaa2b63e337a5ef247111bb5a2733809be
Component: engine
2015-10-02 12:06:03 -07:00
5b5431a0c1 Fixed file modified time not changing on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 40b77af234319f02029368732249c2de0babb380
Component: engine
2015-10-01 10:45:32 -07:00
69db6279aa Revert "Merge pull request #16228 from duglin/ContextualizeEvents"
Although having a request ID available throughout the codebase is very
valuable, the impact of requiring a Context as an argument to every
function in the codepath of an API request, is too significant and was
not properly understood at the time of the review.

Furthermore, mixing API-layer code with non-API-layer code makes the
latter usable only by API-layer code (one that has a notion of Context).

This reverts commit de4164043546d2b9ee3bf323dbc41f4979c84480, reversing
changes made to 7daeecd42d7bb112bfe01532c8c9a962bb0c7967.

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	api/server/container.go
	builder/internals.go
	daemon/container_unix.go
	daemon/create.go
Upstream-commit: b08f071e18043abe8ce15f56826d38dd26bedb78
Component: engine
2015-09-29 14:26:51 -04:00
fef14476a9 Revert "Merge pull request #16567 from calavera/context_per_request"
This reverts commit ff92f45be49146cd7ac7716c36d89de989cb262e, reversing
changes made to 80e31df3b6fdf6c1fbd6a5d0aceb0a148066508c.

Reverting to make the next revert easier.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 79c31f4b13d331d4011b2975a96dcdeab2036865
Component: engine
2015-09-29 13:40:46 -04:00
24818bd478 Merge pull request #16590 from Microsoft/10662-escapeargsfix
Windows: Flags to cmd are now sent as two separate arguments
Upstream-commit: f0e904df8e840911401b73e2f0a24e16b2eb0305
Component: engine
2015-09-25 13:29:54 -07:00
b31922f0fe Merge pull request #16567 from calavera/context_per_request
Define a context per request.
Upstream-commit: ff92f45be49146cd7ac7716c36d89de989cb262e
Component: engine
2015-09-25 13:01:51 -07:00
49fc637581 Flags to cmd are now sent as two separate arguments
This fixes a regression caused by PR #16538.

Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 5aa7c2317a253d88023b6285e50cd660fa351d77
Component: engine
2015-09-25 10:37:53 -07:00
556d0a0826 refactor create to not expose internal data structures
- use existing exposed type

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 93bd57b0b21e1a802b80388c8fc034780e3200fc
Component: engine
2015-09-25 09:35:18 -07:00
00f3eef978 Merge pull request #16571 from skatsuta/fix-typo-comment-evaluator
builder: fix typos in comments
Upstream-commit: 02ae137b1d309729c32110aac6e315e798ba4f0e
Component: engine
2015-09-24 23:44:00 -04:00
8cec2a263a Define a context per request.
Avoid creating a global context object that will be used while the daemon is running.

Not only this object won't ever be garbage collected, but it won't ever be used for anything else than creating other contexts in each request. I think it's a bad practive to have something like this sprawling aroud the code.

This change removes that global object and initializes a context in the cases we don't have already one, like shutting down the server.
This also removes a bunch of context arguments from functions that did nothing with it.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 27c76522dea91ec585f0b5f0ae1fec8c255b7b22
Component: engine
2015-09-24 18:44:53 -04:00
bf44c732da Add context.RequestID to event stream
This PR adds a "request ID" to each event generated, the 'docker events'
stream now looks like this:

```
2015-09-10T15:02:50.000000000-07:00 [reqid: c01e3534ddca] de7c5d4ca927253cf4e978ee9c4545161e406e9b5a14617efb52c658b249174a: (from ubuntu) create
```
Note the `[reqID: c01e3534ddca]` part, that's new.

Each HTTP request will generate its own unique ID. So, if you do a
`docker build` you'll see a series of events all with the same reqID.
This allow for log processing tools to determine which events are all related
to the same http request.

I didn't propigate the context to all possible funcs in the daemon,
I decided to just do the ones that needed it in order to get the reqID
into the events. I'd like to have people review this direction first, and
if we're ok with it then I'll make sure we're consistent about when
we pass around the context - IOW, make sure that all funcs at the same level
have a context passed in even if they don't call the log funcs - this will
ensure we're consistent w/o passing it around for all calls unnecessarily.

ping @icecrime @calavera @crosbymichael

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 26b1064967d9fcefd4c35f60e96bf6d7c9a3b5f8
Component: engine
2015-09-24 11:56:37 -07:00
0577a33a45 builder: fix typos in comments
Signed-off-by: Soshi Katsuta <soshi.katsuta@gmail.com>
Upstream-commit: 53e5f33279c6f21cfd9e8366d240124e62f8a11a
Component: engine
2015-09-25 01:45:59 +09:00
295c5cdefd Windows: Nice error on ARG (builder)
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b69c13b1a643911a541c251b22b4a440197e5f7d
Component: engine
2015-09-21 14:54:15 -07:00
3904dd3167 Move api/errors/ to errors/
Per @calavera's suggestion: https://github.com/docker/docker/pull/16355#issuecomment-141139220

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: a283a30fb026aad4434a9f2e34f7ce955d27a957
Component: engine
2015-09-17 11:54:14 -07:00
0203472d5b Merge pull request #15898 from Microsoft/15775-buildcontextfix
Windows: Fix long path handling for docker build
Upstream-commit: cfd3080a8004738c34ecf1ae0e6cd2f82638c78b
Component: engine
2015-09-17 09:19:23 -07:00
ded3de600a Support for passing build-time variables in build context
- The build-time variables are passed as environment-context for command(s)
run as part of the RUN primitve. These variables are not persisted in environment of
intermediate and final images when passed as context for RUN. The build environment
is prepended to the intermediate continer's command string for aiding cache lookups.
It also helps with build traceability. But this also makes the feature less secure from
point of view of passing build time secrets.

- The build-time variables also get used to expand the symbols used in certain
Dockerfile primitves like ADD, COPY, USER etc, without an explicit prior definiton using a
ENV primitive. These variables get persisted in the intermediate and final images
whenever they are expanded.

- The build-time variables are only expanded or passed to the RUN primtive if they
are defined in Dockerfile using the ARG primitive or belong to list of built-in variables.
HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy, FTP_PROXY and NO_PROXY are built-in
variables that needn't be explicitly defined in Dockerfile to use this feature.

Signed-off-by: Madhav Puri <madhav.puri@gmail.com>
Upstream-commit: 54240f8da9992880e20a1508e9a6f0e59f2adef1
Component: engine
2015-09-16 03:31:15 -07:00
965c460a95 Windows: Fix long path handling for docker build
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: 9b648dfac6453de5944ee4bb749115d85a253a05
Component: engine
2015-09-15 10:58:11 -07:00
700bfcfe4a Merge pull request #15069 from duglin/UseErrorPackage
Use the new error package
Upstream-commit: e91f2c26ce38787e159162d2c4a43744396e3308
Component: engine
2015-09-15 09:28:53 -04:00
bb8ff26c08 Use the new error package
This is the first step in converting out static strings into well-defined
error types.  This shows just a few examples of it to get a feel for how things
will look. Once we agree on the basic outline we can then work on converting
the rest of the code over.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 628b9a41b09fde3ce1493f7d4f1495b9afaa506c
Component: engine
2015-09-14 13:11:01 -07:00
81f0877adb Windows: Nice error on stopsignal
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 8de7fcaf7e9b0c6e99ddd09021e8a746a68a8e63
Component: engine
2015-09-11 09:40:23 -07:00
1e38e54eff Add STOPSIGNAL instruction to dockerfiles.
This way, images creators can set the exit signal their programs use.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 3781cde61ff10b1d9114ae5b4c5c1d1b2c20a1ee
Component: engine
2015-09-10 19:56:05 -04:00
1f9dd04dfa Merge pull request #15877 from Microsoft/10662-trigger
Fix trigger count and output
Upstream-commit: 0009852cb0ceadc398c9d30c7f5494848004c20f
Component: engine
2015-09-03 20:04:05 -07:00
bbd3497cdd Fix trigger count and output
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 662010292619c33db7f144890abfdd9a99b423e0
Component: engine
2015-09-03 17:39:19 -07:00
1e6fd6c910 Merge pull request #16027 from Microsoft/10662-utimes
Windows: Fix dockerfile ADD from HTTP
Upstream-commit: 6ffbea3c94ea4b3f6177dff3e7dc40e4c67dc9f4
Component: engine
2015-09-03 18:44:34 -04:00
c264fc5ef8 Windows: Fix HTTP download directory
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7beb026f0e981df484363ae017d43c8167c80a6e
Component: engine
2015-09-02 16:24:53 -07:00
c4fcb79000 Windows: Fix dockerfile ADD from HTTP
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3715e60c71abbcc794a9ec9f95e06d7a5ae5ee30
Component: engine
2015-09-02 13:53:09 -07:00
49e7160994 Windows: Fix absolute checks
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 49c1b51ae22e54edc2e13f3195583e47b987fc15
Component: engine
2015-09-01 08:41:37 -07:00
6190aee4a2 abstract the string slice struct to stringutils package
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: ea4a06740b6d4579f77507c1d7e0897a870fd72d
Component: engine
2015-08-29 01:08:40 +08:00
5850f3450f Builder counts from 1
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 17d6c6c7e514d6cea0820c6e81924413e9416cad
Component: engine
2015-08-26 10:05:04 -07:00
b498641d47 Merge pull request #14665 from coolljt0725/fix_build_with_resource_limit
Fix build with resource limit which system not support.
Upstream-commit: 6f8c4480e4f99b08c84d25f1611d6b12ee646066
Component: engine
2015-08-25 16:42:13 +02:00
49eee7cf68 Add some builder getEnv tests
In particular I want to make sure that calling getEnv() when the same
var name appears more than once in the env list that we only pick up
the first one.  PR #15182 counts on this

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: eeeae2c235f0f075284008cced669de177dd8747
Component: engine
2015-08-22 13:12:43 -07:00
a9c24d4837 integration-cli: add a integration test to avoid parsing null string in ADD, COPY and VOLUME to nil slice
Signed-off-by: Soshi Katsuta <katsuta_soshi@cyberagent.co.jp>
Upstream-commit: d45fcc6c80bd67ee6a06821fd64cad029d3a756f
Component: engine
2015-08-19 11:11:46 +09:00
8728d5d064 builder: avoid decoding "null" string in ADD, COPY and VOLUME step to nil slice
Signed-off-by: Soshi Katsuta <katsuta_soshi@cyberagent.co.jp>
Upstream-commit: 2d6952e8a52168f7204fc6834e6f5d28a5b21a37
Component: engine
2015-08-18 21:15:57 +09:00
6442b64e6e Fix build with resource limit which system is not support.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 770daa15f359ddc7329a2a031332c251e5a53a29
Component: engine
2015-08-18 11:54:00 +08:00
d9d9dff9a7 Merge pull request #15579 from Microsoft/10662-graph
Windows: Graph remove custom interface, add central store
Upstream-commit: 2e7b088164960b7981a058f34336c05dc52f2c53
Component: engine
2015-08-17 10:45:48 -07:00
73f39654a9 Windows: Graph remove custom interface and add central store
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>

Windows: add support for images stored in alternate location.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: dfbb5520e3b35030f3eef38d5a2d86ad20ea0a2f
Component: engine
2015-08-14 23:45:53 -07:00
49c0f6d3fb Windows: Block 'FROM scratch'
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6df6e2e405a08bac2a81639349bc9a20c6014619
Component: engine
2015-08-14 18:17:19 -07:00
880ecdb34d Windows: Stop commit on running container
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4b933dd2eaae17e4931b7414e3cead370124ec5a
Component: engine
2015-08-13 22:17:03 -07:00
0baccb159d Windows: Error on unsupported builder command
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 394ccfac0782d9877b430b5c7ef75374edcb94e8
Component: engine
2015-08-12 10:02:23 -07:00
2c6e673ce7 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Upstream-commit: 514623272398574c8fd7ef3fe42c5b2ae161349a
Component: engine
2015-08-07 23:25:49 +01:00
87c1161542 Just add some code doc around the use of AddXXX func to avoid any confusion
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 592908c0f5dbad90205764002d7b0079ad18b7a4
Component: engine
2015-08-07 08:07:27 -07:00
761b152e62 Fix uses of "int" where "int64" should be used instead
Some structures use int for sizes and UNIX timestamps. On some
platforms, int is 32 bits, so this can lead to the year 2038 issues and
overflows when dealing with large containers or layers.

Consistently use int64 to store sizes and UNIX timestamps in
api/types/types.go. Update related to code accordingly (i.e.
strconv.FormatInt instead of strconv.Itoa).

Use int64 in progressreader package to avoid integer overflow when
dealing with large quantities. Update related code accordingly.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 1f61084d83aea37b212468aaa975020094b7f7c9
Component: engine
2015-07-31 16:31:40 -07:00
59df5a01ec make docker compile on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 26c03d561ab126287bb3034cc23477d18869a888
Component: engine
2015-07-29 21:25:56 +03:00
3d5c90498b Merge pull request #14759 from vdemeester/pkg-golint
golint on some pkg/* packages
Upstream-commit: 25c42cc0d0a83325817e5fdb8fa654c9e5ab54d5
Component: engine
2015-07-27 15:19:46 -07:00