Commit graph

466 commits

Author SHA1 Message Date
Tibor Vass
2a2d1f57b5 dockerfile: get rid of Commit and CommitConfig
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 400e4922cbd004b93774fc55005f74bd8a995242)
2015-12-15 17:23:40 +01:00
Tibor Vass
63e3816c1d utils: move dockerignore function to builder/dockerignore
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-12-14 14:59:52 +01:00
Tibor Vass
135cca6f52 utils: move git functions to pkg/gitutils
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-12-14 14:59:52 +01:00
Justas Brazauskas
927b334ebf Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
2015-12-13 18:04:12 +02:00
Aaron Lehmann
572ce80230 Improved push and pull with upload manager and download manager
This commit adds a transfer manager which deduplicates and schedules
transfers, and also an upload manager and download manager that build on
top of the transfer manager to provide high-level interfaces for uploads
and downloads. The push and pull code is modified to use these building
blocks.

Some benefits of the changes:

- Simplification of push/pull code
- Pushes can upload layers concurrently
- Failed downloads and uploads are retried after backoff delays
- Cancellation is supported, but individual transfers will only be
  cancelled if all pushes or pulls using them are cancelled.
- The distribution code is decoupled from Docker Engine packages and API
  conventions (i.e. streamformatter), which will make it easier to split
  out.

This commit also includes unit tests for the new distribution/xfer
package. The tests cover 87.8% of the statements in the package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-12-09 19:13:35 -08:00
Morgan Bauer
63fb931a0b
move configs structs to remove dependency on daemon
- Moved the following config structs to api/types
   - ContainerRmConfig
   - ContainerCommitConfig

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-12-07 09:03:25 -08:00
David Calavera
6bb0d1816a Move Container to its own package.
So other packages don't need to import the daemon package when they
want to use this struct.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-12-03 17:39:49 +01:00
Antonio Murdaca
ef1d410b02 fix shm size handling
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-01 16:29:40 +01:00
Arnaud Porterie
bb11900393 Merge pull request #18220 from mqliang/temvarible
remove unnecessary temporary variable
2015-11-26 11:40:02 +01:00
mqliang
478b773fe5 remove unnecessary temporary variable
Signed-off-by: mqliang <mqliang.zju@gmail.com>
2015-11-26 10:25:55 +08:00
Tonis Tiigi
4352da7803 Update daemon and docker core to use new content addressable storage
Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.

Add v1 migration code.

Update registry, api/*, and daemon packages to use the reference
package's types where applicable.

Update daemon package to use image/layer/tag stores instead of the graph
package

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-11-24 09:40:25 -08:00
Antonio Murdaca
1a0b483e02 runconfig: split resources into a struct
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-20 19:40:01 +01:00
NIWA Hideyuki
5aeaf2a0c4 Addition of "--shm-size" to which size of /dev/shm is changed.
- Optional "--shm-size=" was added to the sub-command(run, create,and build).
- The size of /dev/shm in the container can be changed
  when container is made.
- Being able to specify is a numerical value that applies number,
  b, k, m, and g.
- The default value is 64MB, when this option is not set.
- It deals with both native and lxc drivers.

Signed-off-by: NIWA Hideyuki <niwa.hiedyuki@jp.fujitsu.com>
2015-11-20 09:24:18 +09:00
Antonio Murdaca
ad8a66573c Merge pull request #17851 from Microsoft/10662-ArgumentEscaping
Prevent double escaping of Dockerfile commands on Windows
2015-11-14 17:25:53 +01:00
Doug Davis
a5f3ed4801 Merge pull request #17599 from perhapszzy/master
Add line information in the parsed Dockerfile.
2015-11-13 16:53:59 -05:00
perhapszzy@sina.com
5b6c4dd3df Add line information in the parsed Dockerfile
Signed-off-by: perhapszzy@sina.com <perhapszzy@sina.com>
2015-11-13 15:41:12 -05:00
Darren Stahl
9db5db1b94 This fixes the case where arguments are escaped twice from Dockerfiles on
Windows

Signed-off-by: Darren Stahl <darst@microsoft.com>
2015-11-13 10:43:06 -08:00
Vincent Demeester
2a7b5f6657 Merge pull request #17880 from duglin/TweakMap
convert map value from struct to bool
2015-11-11 13:49:50 +01:00
David Calavera
35d9bcdb57 Merge pull request #17732 from Microsoft/sjw/archive_access_time_fix
Fixing last access time on Windows to unblock python.
2015-11-10 13:17:03 -08:00
Doug Davis
fbdce2547f convert map value from struct to bool
Just for @calavera !! :-)
Per: https://github.com/docker/docker/pull/17789#discussion_r44333133

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-11-10 13:10:35 -08:00
David Calavera
014bab03ef Merge pull request #17789 from duglin/Issue17781
Allow for env vars to have spaces in some cases
2015-11-10 08:55:11 -08:00
Doug Davis
6990f8c616 Allow for env vars to have spaces in some cases
Closes #17781

This allows for env vars in EXPOSE to be parsed for spaces so that each
"word" is then treated independently instead of as a single word/arg.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-11-09 12:42:56 -08:00
Antonio Murdaca
343c8547df Merge pull request #17762 from LK4D4/builder_commit
Use name instead of container in Commit
2015-11-08 15:57:13 +01:00
Brian Goff
bf5a6d2a83 Merge pull request #17710 from tonistiigi/fix-builder-symlinks
Fix symlink handling in builder ADD/COPY commands
2015-11-07 16:32:07 -05:00
Vincent Demeester
98a1141db9 Merge pull request #17616 from Microsoft/10662-fix-dockerfile-parser
Windows: Fix dockerfile\parser TestTestData unit test
2015-11-07 09:12:43 +01:00
Tonis Tiigi
47da59f7ec Fix symlink handling in builder ADD/COPY commands
Fixes #17290

Fixes following issues:

- Cache checksums turning off while walking a broken symlink.

- Cache checksums were taken from symlinks while targets were actually copied.

- Copying a symlink pointing to a file to a directory used the basename of the target as a destination basename, instead of basename of the symlink.


Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-11-06 10:58:12 -08:00
Alexander Morozov
38e34cf6da Use name instead of container in Commit
It will make daemon interface separation easier later.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-06 10:22:00 -08:00
David Calavera
3b5fac462d Remove LXC support.
The LXC driver was deprecated in Docker 1.8.
Following the deprecation rules, we can remove a deprecated feature
after two major releases. LXC won't be supported anymore starting on Docker 1.10.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-05 17:09:57 -05:00
Stefan J. Wernli
37ba67bf63 Fixing last access time on Windows to unblock python.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-11-05 12:15:18 -08:00
David Calavera
3a49765046 Decouple daemon and container to mount and unmount filesystems.
Side effects:
- Decouple daemon and container to start containers.
- Decouple daemon and container to copy files.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-04 12:27:47 -05:00
David Calavera
4f2a5ba360 Decouple daemon and container to stop and kill containers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-04 12:27:47 -05:00
John Howard
864e892e2a Windows: Fix dockerfile\parser unit test
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-01 20:08:37 -08:00
John Howard
d5c85897f4 Windows: Allows --isolation on docker build
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-30 11:14:38 -07:00
Alexander Morozov
1477a3d7fd Fix dumper program to use proper import
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-26 13:10:01 -07:00
Tibor Vass
e74cf8acad Merge pull request #16433 from Microsoft/10662-volumes5
Windows: [TP4] Add volume support
2015-10-23 18:43:07 -04:00
John Howard
a7e686a779 Windows: Add volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-22 10:42:53 -07:00
Daehyeok Mun
bb79b7eb9e ProcessWord support UTF-8
modified PorcessWord to working normally for UTF-8 strings and added test cases

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2015-10-21 10:10:10 -06:00
Lei Jitang
9392de9dfe Fix cancel build doesn't remove the intermediate container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-16 05:18:10 -04:00
Morgan Bauer
844fb29619
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>
2015-10-12 16:20:55 -07:00
Doug Davis
4920d40093 Add useful info to builder cache logrus.Debug
Closes: #16790

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-10-10 05:53:06 -07:00
John Howard
9cd84e405d Windows: Regression re-fix builder
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-07 15:57:37 -07:00
Tibor Vass
e0ef11a4c2 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>
2015-10-06 19:10:19 -04:00
Tibor Vass
f41230b93a Move builder files to builder/dockerfile
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-10-05 18:26:47 -04:00
Jess Frazelle
134fefbaa2 Merge pull request #16490 from Microsoft/10662-mtimefix
Fixed file modified time not changing on windows
2015-10-02 12:06:03 -07:00
Darren Stahl
40b77af234 Fixed file modified time not changing on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2015-10-01 10:45:32 -07:00
Tibor Vass
b08f071e18 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 de41640435, reversing
changes made to 7daeecd42d.

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

Conflicts:
	api/server/container.go
	builder/internals.go
	daemon/container_unix.go
	daemon/create.go
2015-09-29 14:26:51 -04:00
Tibor Vass
79c31f4b13 Revert "Merge pull request #16567 from calavera/context_per_request"
This reverts commit ff92f45be4, reversing
changes made to 80e31df3b6.

Reverting to make the next revert easier.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-09-29 13:40:46 -04:00
David Calavera
f0e904df8e Merge pull request #16590 from Microsoft/10662-escapeargsfix
Windows: Flags to cmd are now sent as two separate arguments
2015-09-25 13:29:54 -07:00
Jess Frazelle
ff92f45be4 Merge pull request #16567 from calavera/context_per_request
Define a context per request.
2015-09-25 13:01:51 -07:00
Darren Stahl
5aa7c2317a 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>
2015-09-25 10:37:53 -07:00
Morgan Bauer
93bd57b0b2
refactor create to not expose internal data structures
- use existing exposed type

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-09-25 09:35:18 -07:00
Doug Davis
02ae137b1d Merge pull request #16571 from skatsuta/fix-typo-comment-evaluator
builder: fix typos in comments
2015-09-24 23:44:00 -04:00
David Calavera
27c76522de 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>
2015-09-24 18:44:53 -04:00
Doug Davis
26b1064967 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>
2015-09-24 11:56:37 -07:00
Soshi Katsuta
53e5f33279 builder: fix typos in comments
Signed-off-by: Soshi Katsuta <soshi.katsuta@gmail.com>
2015-09-25 01:45:59 +09:00
John Howard
b69c13b1a6 Windows: Nice error on ARG (builder)
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-21 14:54:15 -07:00
Doug Davis
a283a30fb0 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>
2015-09-17 11:54:14 -07:00
David Calavera
cfd3080a80 Merge pull request #15898 from Microsoft/15775-buildcontextfix
Windows: Fix long path handling for docker build
2015-09-17 09:19:23 -07:00
Madhav Puri
54240f8da9 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>
2015-09-16 03:31:15 -07:00
Stefan J. Wernli
9b648dfac6 Windows: Fix long path handling for docker build
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-09-15 10:58:11 -07:00
Brian Goff
e91f2c26ce Merge pull request #15069 from duglin/UseErrorPackage
Use the new error package
2015-09-15 09:28:53 -04:00
Doug Davis
628b9a41b0 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>
2015-09-14 13:11:01 -07:00
John Howard
8de7fcaf7e Windows: Nice error on stopsignal
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-11 09:40:23 -07:00
David Calavera
3781cde61f 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>
2015-09-10 19:56:05 -04:00
Alexander Morozov
0009852cb0 Merge pull request #15877 from Microsoft/10662-trigger
Fix trigger count and output
2015-09-03 20:04:05 -07:00
John Howard
6620102926 Fix trigger count and output
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-03 17:39:19 -07:00
Tibor Vass
6ffbea3c94 Merge pull request #16027 from Microsoft/10662-utimes
Windows: Fix dockerfile ADD from HTTP
2015-09-03 18:44:34 -04:00
John Howard
7beb026f0e Windows: Fix HTTP download directory
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-02 16:24:53 -07:00
John Howard
3715e60c71 Windows: Fix dockerfile ADD from HTTP
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-02 13:53:09 -07:00
John Howard
49c1b51ae2 Windows: Fix absolute checks
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-01 08:41:37 -07:00
Shijiang Wei
ea4a06740b abstract the string slice struct to stringutils package
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-08-29 01:08:40 +08:00
John Howard
17d6c6c7e5 Builder counts from 1
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-08-26 10:05:04 -07:00
David Calavera
6f8c4480e4 Merge pull request #14665 from coolljt0725/fix_build_with_resource_limit
Fix build with resource limit which system not support.
2015-08-25 16:42:13 +02:00
Doug Davis
eeeae2c235 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>
2015-08-22 13:12:43 -07:00
Soshi Katsuta
d45fcc6c80 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>
2015-08-19 11:11:46 +09:00
Soshi Katsuta
2d6952e8a5 builder: avoid decoding "null" string in ADD, COPY and VOLUME step to nil slice
Signed-off-by: Soshi Katsuta <katsuta_soshi@cyberagent.co.jp>
2015-08-18 21:15:57 +09:00
Lei Jitang
770daa15f3 Fix build with resource limit which system is not support.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-18 11:54:00 +08:00
David Calavera
2e7b088164 Merge pull request #15579 from Microsoft/10662-graph
Windows: Graph remove custom interface, add central store
2015-08-17 10:45:48 -07:00
Stefan J. Wernli
dfbb5520e3 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>
2015-08-14 23:45:53 -07:00
John Howard
6df6e2e405 Windows: Block 'FROM scratch'
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-08-14 18:17:19 -07:00
John Howard
4b933dd2ea Windows: Stop commit on running container
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-08-13 22:17:03 -07:00
John Howard
394ccfac07 Windows: Error on unsupported builder command
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-08-12 10:02:23 -07:00
Veres Lajos
5146232723 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
2015-08-07 23:25:49 +01:00
Doug Davis
592908c0f5 Just add some code doc around the use of AddXXX func to avoid any confusion
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-08-07 08:07:27 -07:00
Aaron Lehmann
1f61084d83 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>
2015-07-31 16:31:40 -07:00
Alexey Guskov
26c03d561a make docker compile on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
2015-07-29 21:25:56 +03:00
Jessie Frazelle
25c42cc0d0 Merge pull request #14759 from vdemeester/pkg-golint
golint on some pkg/* packages
2015-07-27 15:19:46 -07:00
Vincent Demeester
18c7c67308 Lint on pkg/* packages
- pkg/useragent
- pkg/units
- pkg/ulimit
- pkg/truncindex
- pkg/timeoutconn
- pkg/term
- pkg/tarsum
- pkg/tailfile
- pkg/systemd
- pkg/stringutils
- pkg/stringid
- pkg/streamformatter
- pkg/sockets
- pkg/signal
- pkg/proxy
- pkg/progressreader
- pkg/pools
- pkg/plugins
- pkg/pidfile
- pkg/parsers
- pkg/parsers/filters
- pkg/parsers/kernel
- pkg/parsers/operatingsystem

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-27 21:26:21 +02:00
Vincent Demeester
5170a2c096 Lint fixes on runconfig
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-27 21:23:15 +02:00
Lei
877dbbbde8 Add ulimit to docker build.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-23 10:26:06 +08:00
Qiang Huang
8c4a282a57 Fix golint warnings for builder
Addresses: #14756

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-22 13:29:03 +08:00
John Howard
9001ea26e7 Fixing Image struct to no longer use Graph.
Signed-off-by:  John Howard <jhoward@microsoft.com>
2015-07-20 13:59:53 -07:00
Ma Shimiao
1b67c38f6f fix 8926: rmi dangling is unsafe when pulling
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-17 11:39:57 -04:00
Doug Davis
13c08b898b Cleanup build tmp dir stuff
If there's an error while unpacking the build context then we weren't erasing
the tmp dir created to persist the context.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-15 06:23:19 -07:00
John Howard
2ceb114607 Windows: Fix builder
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-12 09:06:18 -07:00
Jessie Frazelle
4aeb84612f Merge pull request #14371 from Microsoft/10662-graphdriver
Windows: Graph driver implementation
2015-07-10 15:35:00 -07:00
John Howard
52f4d09ffb Windows: Graph driver implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-10 14:33:11 -07:00
Doug Davis
0bf0e5a6ef Align 'docker commit' docs with the code
It was missing some variants and 'maintainer' isn't actually supported.
Also sorted the list of allowed cmds in the code just to make it easier
to diff with the docs.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-09 13:17:47 -07:00
Alexander Morozov
53b897ce9c Merge pull request #13744 from turtlebender/feature/whitelist-label-for-commit
Support LABEL as change for `docker commit`
2015-07-01 10:57:33 -07:00
Peter Waller
9c2374d196 Move /nat to /pkg/nat
By convention /pkg is safe to use from outside the docker tree, for example
if you're building a docker orchestrator.

/nat currently doesn't have any dependencies outside of /pkg, so it seems
reasonable to move it there.

This rename was performed with:

```
gomvpkg -vcs_mv_cmd="git mv {{.Src}} {{.Dst}}" \
	-from github.com/docker/docker/nat \
        -to   github.com/docker/docker/pkg/nat

```

Signed-off-by: Peter Waller <p@pwaller.net>
2015-06-30 17:43:17 +01:00
David Calavera
d543a01e17 Merge pull request #14061 from runcom/clean-builder-daemon-config
Add struct to configure Builder commit
2015-06-29 11:04:05 -07:00
Tibor Vass
dd408891ba Merge pull request #14139 from jlhawn/fix_build_with_auth
[api, builder] Fix build auth config
2015-06-25 17:39:36 -07:00
Josh Hawn
02c7bbefb8 [api, builder] Fix build auth config
With the 1.7 release, we introduced a change to how we store registry
credentials, but the build API endpoint did not expect a change in the format
of that file. This patch fixes this problem so that you can again pull private
images during `docker build`.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-06-23 12:58:17 -07:00
Alexander Morozov
d5721f0385 Merge pull request #13833 from Microsoft/10662-dockerbuild
Windows: Start docker build working
2015-06-23 11:46:56 -07:00
David Calavera
f39b9a0b0f Merge pull request #14071 from mavenugo/mhnet
Vendoring libnetwork 83743db8ceb2bdbfa0960d9a54ed2f98df4ea846
2015-06-22 08:35:18 -07:00
Madhu Venugopal
53b0f686f7 Removed the default "bridge" in builder
Now that the default network mode is "default" and this mode is chosen
even if the mode is empty string, it is not correct to have builder
still pointing to "bridge" as default (though this is daemon default).

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-22 04:15:56 -07:00
Antonio Murdaca
7046651b87 Add struct to configure Builder commit instead of using one defined in daemon
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-20 12:53:47 +02:00
Moysés Borges
d48bface59 Support downloading remote tarball contexts in builder jobs.
Signed-off-by: Moysés Borges <moysesb@gmail.com>
2015-06-19 16:35:00 -03:00
John Howard
3c177dc877 Windows: Docker build starting to work
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-17 10:41:28 -07:00
Tom Howe
6e2662b3ba just adding label to whitelist for commit command (Fixes #13738)
Signed-off-by: Tom Howe <turtlebender@gmail.com>
2015-06-16 13:59:16 -05:00
Mary Anthony
cd44018856 Carry of PR #13520
Removinig files

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-13 09:27:30 -07:00
Josh Hawn
0e10507a1c [builder] Make build cache ignore mtime
Build cache uses pgk/tarsum to get a digest of content which is
ADD'd or COPY'd during a build. The builder has always used v0 of
the tarsum algorithm which includes mtimes however since the whole
file is hashed anyway, the mtime doesn't really provide any extra
information about whether the file has changed and many version
control tools like Git strip mtime from files when they are cloned.

This patch updates the build subsystem to use v1 of Tarsum which
explicitly ignores mtime when calculating a digest. Now ADD and
COPY will result in a cache hit if only the mtime and not the file
contents have changed.

NOTE: Tarsum is NOT a meant to be a cryptographically secure hash
function. It is a best-effort approach to determining if two sets of
filesystem content are different.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-06-08 13:54:47 -07:00
Antonio Murdaca
4ce817796e Avoid nil pointer dereference while creating a container with an empty Config
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-06 20:07:32 +02:00
Antonio Murdaca
15134a3320 Remove PortSpecs from Config
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-29 22:38:09 +02:00
Brian Goff
33c7c01a62 Merge pull request #13055 from Microsoft/10662-internalsfixperms
Windows: Fixup builder/internals.go
2015-05-28 12:31:45 -04:00
Brian Goff
f8628ba891 Cleanup container rm funcs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-26 15:38:52 -04:00
David Calavera
81fa9feb0c Volumes refactor and external plugin implementation.
Signed by all authors:

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Jeff Lindsay <progrium@gmail.com>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Signed-off-by: Luke Marsden <luke@clusterhq.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-21 20:34:17 -07:00
John Howard
010e3e046b Windows: Fixup builder\internals.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-20 08:55:13 -07:00
unclejack
d6a545a989 builder/internals: set up network as bridge
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-05-15 22:58:21 +03:00
Tibor Vass
3985f17812 Merge pull request #13131 from Microsoft/10662-loadonwindows
Windows: Build load.go
2015-05-12 18:04:33 -07:00
Antonio Murdaca
6b700bdaca Refactor pkg/stremformatter with custom constructors instead of passing a boolean
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-13 00:09:41 +02:00
John Howard
aed8f9f76e Windows: Build load.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-12 14:26:57 -07:00
Alexander Morozov
f35038dfba Merge pull request #13160 from runcom/remove-api-codepath-less-than-1-12
Remove API codepaths < 1.12
2015-05-12 13:08:36 -07:00
Jessie Frazelle
73387bf15a Merge pull request #13105 from duglin/FixRunOutput
Fix RUN err msg (again)
2015-05-12 11:36:55 -07:00
Antonio Murdaca
7284b08204 Remove API codepaths < 1.12
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-12 20:09:49 +02:00
Michael Crosby
e66ad40c4e Merge pull request #12994 from Microsoft/10662-fixinvocation
Windows: Fix builder\dispatchers.go
2015-05-11 11:24:43 -07:00
Doug Davis
006c066b6c Fix RUN err msg (again)
Previous fix used %q which incorrectly go-escaped things. For example:

```
RUN echoo A \& B	C
```
would result in the user seeing:
```
INFO[0000] The command '/bin/sh -c echoo A \\& B\tC' returned a non-zero code: 127
```
Note the double-\ and the \t instead of a tab character

The testcase had to double escape things due to logrus getting in the way
but I'm going to fix that in another PR because its a change to the UX.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-09 09:22:30 -07:00
Ma Shimiao
dccb8b5c33 add cpu.cfs_period_us support
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-05-09 10:02:46 +08:00
John Howard
4d2f6fbde0 Windows: Fix builder\dispatchers.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-08 11:45:08 -07:00
Jessie Frazelle
d0bc0153c6 Merge pull request #12278 from duglin/12267-Wildcards
Fix for Daemon crashing when wildcards are used for COPY/ADD
2015-05-07 17:01:16 -07:00
Arnaud Porterie
596e91638c Remove unused Dockerfile instruction INSERT
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-06 16:26:43 -07:00
Doug Davis
54662eae10 Fix RUN's error msg when it fails
When RUN returns with a non-zero return code it prints the command
that was executed as a Go []string:
```
INFO[0000] The command &{[/bin/sh -c noop a1 a2]} returned a non-zero code: 127
```

instead it should look like this:
```
INFO[0000] The command "/bin/sh -c noop a1 a2" returned a non-zero code: 127
```

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-05 16:08:41 -07:00
Doug Davis
08b7f30fcd Fix issue where build steps are duplicated in the output
This fixes an issue where the build output for the "Steps" would look like:
```
Step 1: RUN echo hi echo hi
```
instead of
```
Step 1: RUN echo hi
```

Also, I noticed that there were no checks to make sure invalid Dockerfile
cmd flags were caught on cmds that didn't use cmd flags at all. They would
have been caught on the cmds that had flags, but cmds that didn't bother
to add a new code for flags would have just ignored them.  So, I added
checks to each cmd to flag it.

Added testcases for issues.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-05 15:28:42 -07:00
Arnaud Porterie
e960e4bb12 Merge pull request #11844 from jbarbier/cgroup-parent-42
Adding cgroup-parent option for docker build
2015-05-05 14:46:47 -07:00
Arnaud Porterie
9c32cd1cef Merge pull request #10775 from duglin/BuilderFlags
Add support for Dockerfile CMD options
2015-05-04 11:39:09 -07:00
Brian Goff
d2f0b9ed97 Merge pull request #11190 from cyphar/expose-path-sanitisation-wrappers
Expose the getResourcePath and getRootResourcePath wrappers.
2015-04-28 18:45:36 -04:00
Doug Davis
a8e871b0bb Add support for Dockerfile CMD options
This adds support for Dockerfile commands to have options - e.g:
   COPY --user=john foo /tmp/
   COPY --ignore-mtime foo /tmp/

Supports both booleans and strings.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-28 05:28:46 -07:00
Doug Davis
82daa43844 Fix for Daemon crashing when wildcards are used for COPY/ADD
in the filename and the command itself

Closes #12267

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-27 19:09:57 -07:00
Phil Estes
0153edcda1 Merge pull request #12828 from tdmackey/trivial-spelling
trivial: typo cleanup
2015-04-27 17:05:46 -04:00
David Mackey
3941623fbc trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
2015-04-27 13:35:08 -07:00
Antonio Murdaca
844538142d Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-27 21:50:33 +02:00
Antonio Murdaca
26543e0309 Replace json.Unmarshal with json.Decoder().Decode()
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-26 15:02:01 +02:00
Julien Barbier
bb41193998 Happy birthday Docker! cgroup-parent option for docker build. Thanks to Michael, Nathan and Jessie for their support! #42
Signed-off-by: Julien Barbier <write0@gmail.com>
2015-04-25 15:25:51 -04:00
Alexander Morozov
790c63a5ef Merge pull request #12502 from calavera/shallow_git_history
Shallow clone using git to build images.
2015-04-24 10:16:01 -07:00
David Calavera
1cfb307d70 Remove duplicated git clone logic.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:45 -07:00
David Calavera
3117bf3ef5 Test that we set the right arguments for git cloning depending on the transport.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:38 -07:00
David Calavera
9fb7204a41 Do not try to shallow git history when the protocol doesn't allow it.
This only happens with the old git http dumb protocol, but that's what we use in our integration tests.
We check the Content-Type header advertised in http requests to make sure the http transport is the git smart transport:

See this commit as a reference:
4656bf47fc

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:38 -07:00
David Calavera
36fbf4b864 Shallow clone using git to build images.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:38 -07:00
Aleksa Sarai
b7c3c0cb69 *: switch to Get(Root)?ResourcePath where appropriate
Several parts of the codebase didn't use the correct path sanitisation
wrappers. Now that the wrappers have been exposed, use those.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2015-04-25 00:10:29 +10:00
Lei Jitang
5f4fb8be00 Add cpu cfs quota to build
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-24 08:54:08 +08:00