Commit graph

461 commits

Author SHA1 Message Date
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
Doug Davis
bb9da6ba92 Move CLI config processing out from under registry dir
No logic changes should be in here, just moving things around.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-23 10:18:38 -07:00
Alexander Morozov
a2f74aa4b4 Remove chain of engine passing from builder to loadManifest
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 14:55:23 -07:00
David Calavera
ae4063585e Remove engine.Job from builder.CmdBuildConfig.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-20 13:37:06 -07:00
David Calavera
9a2c009751 Remove engine.Job references from builder.CmdBuild
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-20 13:37:04 -07:00
Alexander Morozov
08ef006d17 Merge pull request #12009 from duglin/AddConfig
Migrate .dockercfg to .docker/config.json and support for HTTP Headers
2015-04-20 13:12:17 -07:00
Doug Davis
18c9b6c645 Add .docker/config.json and support for HTTP Headers
This PR does the following:
- migrated ~/.dockerfg to ~/.docker/config.json. The data is migrated
  but the old file remains in case its needed
- moves the auth json in that fie into an "auth" property so we can add new
  top-level properties w/o messing with the auth stuff
- adds support for an HttpHeaders property in ~/.docker/config.json
  which adds these http headers to all msgs from the cli

In a follow-on PR I'll move the config file process out from under
"registry" since it not specific to that any more. I didn't do it here
because I wanted the diff to be smaller so people can make sure I didn't
break/miss any auth code during my edits.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-20 13:05:24 -07:00
Alexander Morozov
a7690076c9 Merge pull request #12453 from runcom/style-minor-fixes
Add minor stylistic fixes
2015-04-20 11:51:04 -07:00
Doug Davis
b1d8ae3824 Merge pull request #12358 from ZJU-SEL/remove_job_from_tag
remove job from tag
2015-04-19 16:02:28 -04:00
Simei He
99f6309b97 remove job from tag
Signed-off-by: Simei He <hesimei@zju.edu.cn>
2015-04-19 18:36:56 +08:00
Brian Goff
055c6dbaef Merge pull request #12490 from LK4D4/carry_12396
remove job from pull and import
2015-04-17 15:26:30 -04:00
Simei He
6e38a53f96 remove job from pull and import
Closes #12396

Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-17 09:55:02 -07:00
Antonio Murdaca
1c89c6ea2f Add minor stylistic fixes
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-16 21:22:32 +02:00
Brian Goff
de923f59b3 Merge pull request #12253 from calavera/remove_job_from_start_and_create
Remove engine.Job from Start and Create
2015-04-15 21:49:25 -04:00
David Calavera
767df67e31 Decode container configurations into typed structures.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-15 10:22:07 -07:00
Qiang Huang
f8dc7e8754 Add cpuset-mems support for docker build
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-15 09:34:12 +08:00
Antonio Murdaca
c30a55f14d Refactor utils/utils, fixes #11923
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-14 01:37:36 +02:00
y00277921
24dd8a4698 Fix a typo in comment of parseMaybeJSONToList
Signed-off-by: Yu Changchun <yuchangchun1@huawei.com>
2015-04-11 10:34:21 +08:00
David Calavera
bbdf045ac1 Fix typo in builder/dispatchers.go
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-09 11:43:05 -07:00
Alexander Morozov
c44f513248 Remove engine usage from attach
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 14:23:09 -07:00
Tibor Vass
9707286a5c Merge pull request #11149 from duglin/8667-AdvancedVars
Add support for advanced ${} uses
2015-04-02 08:25:49 -04:00
Doug Davis
39908fc6d9 Add support for more advanced ${xxx:...} syntax
Just ${xxx:+...} and ${xxx:-...} for now

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-01 08:11:15 -07:00
Michael Crosby
03d3d79b2b Remove jobs from registry.Service
This makes `registry.Service` a first class type and does not use jobs
to interact with this type.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-31 16:38:04 -07:00
Lei Jitang
013fb87543 Fix error from daemon no such image even when the image exist
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-28 09:07:20 +08:00
Antonio Murdaca
6f4d847046 Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-26 23:22:04 +01:00
bobby abbott
0cd6c05d81 Fixes hacks from progressreader refactor
related to #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-03-25 18:21:02 -07:00
Antonio Murdaca
c79b9bab54 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-25 22:32:08 +01:00
Vincent Batts
7617ec176d .: remove trailing white spaces
blame tibor this one ;-)
```
find . -type f -not -name '*.png' -not -name '*.go' -not -name '*.md'
-not -name '*.tar' -not -name '*.pem' -not -path './vendor/*' -not -path
'./.git/*' -not -path '*/testdata/*' -not -path './docs/*images*' -not
-path '*/testfiles/*' -not -path './bundles/*' -not -path
'./docs/*static*/*' -not -path './docs/*article-img/*' -exec grep -HnEl
'[[:space:]]$' {} \; | xargs sed -iE 's/[[:space:]]*$//'
```

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-03-25 13:38:17 -04:00
Antonio Murdaca
b80fae7356 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-24 18:19:59 +01:00
Tibor Vass
92f9e2d395 Merge pull request #11657 from GeorgeMac/cleanup-redundant-else
#11602 - Cleanup redundant else statements find via golint
2015-03-23 18:27:29 -05:00
Alexander Morozov
9f894c93e4 Merge pull request #11658 from 4gh/doc_package_builder
Add builder/evaluator comments for the package in godoc-style
2015-03-23 14:27:23 -07:00
Frank Herrmann
a0cd004528 Add builder/evaluator comments for the package in godoc-style
fixes #11617

Signed-off-by: Frank Herrmann <fgh@4gh.tv>
2015-03-23 20:56:03 +00:00
George MacRorie
664ef0cbe2 Cleanup redundant else statements find via golint #11602
Signed-off-by: George MacRorie <gmacr31@gmail.com>
2015-03-23 20:40:29 +00:00
Antonio Murdaca
8b02d85e17 Remove hardcoded error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-23 20:58:16 +01:00
Tibor Vass
61966d281b Merge pull request #10431 from duglin/Issue10391
Clarify ENV non-recursivenes w.r.t. env var substitution + fix escaping
2015-03-23 13:30:11 -05:00
Arnaud Porterie
ded0ada9b4 Merge pull request #11538 from duglin/EmptyVolume
Check volume path to make sure its not the empty string
2015-03-22 19:25:50 -07:00
Peter Waller
671c12204c Implement build cancellation
Add the capability to cancel the build by disconnecting the client.

This adds a `cancelled` channel which is used to signal that a build
should halt. The build is halted by sending a Kill signal and noticing
that the cancellation channel is closed.

This first pass implementation does not allow cancellation during a
pull, but that will come in a subsequent PR.

* Add documentation of cancellation to cli and API

* Protect job cancellation with sync.Once

* Add TestBuildCancelationKillsSleep

* Add test case for build cancellation of RUN statements.

Signed-off-by: Peter Waller <p@pwaller.net>
2015-03-22 11:31:28 +00:00
Doug Davis
8071bf3967 Check volume path to make sure its not the empty string
With this Dockerfile
```
FROM ubuntu
ENV ABC=""
VOLUME $ABC
```

It builds ok but then at run time I get this error:

FATA[0002] Error response from daemon: Cannot start container 8902b4a7aaf5c4e4b11a38070d392db465fa97ad88c91c8b38dda5ab8149ccac: [8] System error: no such file or directory

Because the Volume config shows "" as the path.  This PR checks for "" as
the path and stops it at build time.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-20 21:39:49 -07:00
Doug Davis
6d66e3e7a5 Fix some escaping around env var processing
Clarify in the docs that ENV is not recursive

Closes #10391

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-20 20:09:00 -07:00
Brian Goff
e6ae89a45a Allow setting resource constrains for build
Closes #10191

Allow `docker build` to set --cpu-shares, --cpuset, --memory,
--memory-swap for all containers created by the build.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-18 20:57:13 -04:00
Doug Davis
6784a772ba Some fixed for new LABEL stuff
- command.Commands was missing "Label"
- used the correct error string in dispatcher when LABEL has no args, otherwise
  the test TestBuildMissingArgs will not work
- removed the premature error msg in line_parser that was blocking the
  label() func in dispatcher from showing the err msg in previous bullet
- since LABEL uses the env parser it needs to be added to the replaceEnvAllowed
  list so that proper quote processing will be done.  Especially once
  PR #10431 is merged.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-16 22:53:41 -07:00
Arnaud Porterie
b6ac111abf Merge pull request #9882 from ibuildthecloud/labels
Proposal: One Meta Data to Rule Them All => Labels
2015-03-16 20:20:05 -07:00
Michael Crosby
88f437d6c6 Merge pull request #11402 from miminar/err-cleanup
Error formatting cleanups
2015-03-16 16:13:16 -07:00
Tibor Vass
085054db9d Merge pull request #10591 from duglin/ErrUnknownCmd
Generate an error on unknown Dockerfile instruction
2015-03-16 17:47:28 -04:00
Alexander Morozov
8ae20d8eba Merge pull request #10977 from robertabbott/10959-progressreader
Moves progressreader from utils to its own package
2015-03-16 12:45:33 -07:00
Michal Minar
210ab030bc Format error by value
- Use `%v` verb to format errors.
- Give `param` constant in portallocator some better name.

Signed-off-by: Michal Minar <miminar@redhat.com>
2015-03-16 12:05:53 +01:00
Doug Davis
8a5b50d65d Generate an error on unknown Dockerfile instruction
Instead of just printing a warning and going on, this will generate
an error and stop processing.

This used to be part of #10561 but I decided it might need its own
independent discussion/PR as to not derail #10561.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-13 16:08:34 -07:00
Dan Walsh
cdfdfbfb62 Allow specification of Label Name/Value pairs in image json content
Save "LABEL" field in Dockerfile into image content.

This will allow a user to save user data into an image, which
can later be retrieved using:

docker inspect IMAGEID

I have copied this from the "Comment" handling in docker images.

We want to be able to add Name/Value data to an image to describe the image,
and then be able to use other tools to look at this data, to be able to do
security checks based on this data.

We are thinking about adding version names,
Perhaps listing the content of the dockerfile.
Descriptions of where the code came from etc.

This LABEL field should also be allowed to be specified in the
docker import --change LABEL:Name=Value
docker commit --change LABEL:Name=Value

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-03-13 09:47:09 -07:00
Doug Davis
645f8a32df Fix builder when num of RUN args is 1
FROM scratch
ADD echo /
RUN [ "echo" ]

will die with
  exec: "/bin/sh": stat /bin/sh: no such file or directory

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-11 07:30:44 -07:00
bobby abbott
12b278d354 Remove import to utils in progressreader
Added method in StreamFormatter to handle calls
from progressreader. Solves #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-03-11 00:50:27 -07:00
Sebastiaan van Stijn
9e63b0d0f9 cleanup: simplify parser_test
parser_test only needed the directory-names for
the tests to run. This replaces f.Readdir() with
f.Readdirnames() to only return the names.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-03-10 00:55:00 +01:00
Alexander Morozov
c5f9aa18f4 Merge pull request #11219 from icecrime/remove_maintainers_files
Remove subdirectories MAINTAINERS files
2015-03-09 09:02:58 -07:00
Arnaud Porterie
89bdaa35e0 Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-06 18:21:51 -08:00
Chen Hanxiao
26e85b0db1 dispatchers: warn user if try to use EXPOSE ip:hostPort:containerPort
We could use EXPOSE ip:hostPort:containerPort,
but actually it did as EXPOSE ::containerPort

commit 2275c833 already warned user on daemon side.
This patch will print warning message on client side.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-04 21:09:50 -05:00
Alexander Morozov
e0823b09ec Merge pull request #11000 from anandkumarpatel/invalidate-probe
Improve build speed
2015-03-04 11:35:00 -08:00
Doug Davis
15924f2385 Support dockerfile and Dockerfile
Closes #10807

Adds support for `dockerfile` ONLY when `Dockerfile` can't be found.
If we're building from a Dockerfile via stdin/URL then always download
it a `Dockerfile` and ignore the -f flag.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-03 18:38:50 -08:00
AnandkumarPatel
1a5ea50aa8 Remove comment and b.UtilizeCache check.
Signed-off-by: AnandkumarPatel <anandkumarpatel@gmail.com>
2015-02-25 14:04:35 -08:00
AnandkumarPatel
2420c1f03b Add cacheBusted flag which gets set on the first cache miss
Refactor of probeCache function

Signed-off-by: AnandkumarPatel <anandkumarpatel@gmail.com>
2015-02-25 10:27:32 -08:00
AnandkumarPatel
1e746a8a2b Set UtilizeCache to false on cache miss
Signed-off-by: Anandkumar Patel <anandkumarpatel@gmail.com>

Signed-off-by: AnandkumarPatel <anandkumarpatel@gmail.com>
2015-02-24 18:29:26 -08:00
Dan Walsh
17abfc3ddc pass --change changes to the import job
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-02-24 13:01:36 -05:00
Michael Crosby
3210d13fc8 Return error on invalid --change command
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Docker-DCO-1.1-Signed-off-by: Michael Crosby <crosbymichael@gmail.com> (github: rhatdan)
2015-02-24 13:01:35 -05:00
Dan Walsh
7f091eca70 build_config job: parse dockerfile ast into config
Instead of building the actual image, `build_config` will serialize a subset of
dockerfile ast into *runconfig.Config

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-02-24 13:01:35 -05:00
Jessie Frazelle
ac06d0c46a Merge pull request #10921 from duglin/FixNonverboseBuild
Build w/o verbose hangs w/RUN
2015-02-23 15:15:12 -08:00
Srini Brahmaroutu
7a9c944b82 Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-23 18:43:10 +00:00
Rik Nijessen
ba93f8316c Rename Destroy to Rm to be consistent with CLI.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
2015-02-23 16:15:56 +01:00
Doug Davis
92c353582c Build w/o verbose hangs w/RUN
`docker build -q .` where Dockerfile contains a RUN cmd will hang on the
RUN. It waits for the output stream to close but because of -q we never
attached to the container and end up waiting forever.

The fact that no one noticed this tells me that people may not actually
use -q and if so I wonder if it would make sense to make -q work the may
it does for other commands (like `docker ps`) and make it so it only
shows the container ID at the end.  A -q/quiet option that only hides the
container RUN output apparently isn't really that useful since no one is
using it.  See: https://github.com/docker/docker/issues/4094

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-02-20 13:38:03 -08:00
kargakis
6ecf23861e Map Commands instead of using them as a slice
The most obvious use case is when one wants to make sure as fast
as possible that a command is a valid Dockerfile command.

Signed-off-by: kargakis <kargakis@users.noreply.github.com>
2015-02-20 15:56:21 +01:00
Ahmet Alp Balkan
72a070c5da builder/parser: Make use of builder/command
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-11 23:54:41 -08:00
Ahmet Alp Balkan
ccde3a1f73 Create builder/command, cut libcontainer dependency on integration-cli
d1e9d07c introduces a dependency to libcontainer and other daemon
related packages through builder package. The only thing test needs
is set of the Dockerfile commands. Extracting them to a separate
package.

This was causing CI tests to not to compile on non-Linux platforms.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-11 21:44:31 -08:00
Doug Davis
1654dfdf14 Show err msg on empty 'scratch' Dockerfile
If you have a Dockefile with just:
   FROM scratch

An error is generated but its never shown to the CLI. This PR fixes that.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-02-10 11:43:45 -08:00
Doug Davis
d1e9d07c1b Get list of Dockerfile cmds from builder so we can be smarted in our tests
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-02-08 08:09:02 -08:00
Doug Davis
e4f02abb51 Add support for no-arg commands in Dockerfile
We're hoping to add some new commands that don't have any args so this
PR will enable that by removing all of the hard-coded checks that require
commands to have at least one arg.  It also adds some checks to each
command so we're consistent in the error message we get.  Added a test
for this too.

We actually had this check in at least 3 different places (twice in the
parser and once in most cmds), this removes 2 of them (the parser ones).

Had to remove/modify some testcases because its now legal to have certain
commands w/o args - e.g. RUN. This was actually inconsistent because
we used to allow "RUN []" but not "RUN" even though they would generate
(almost) the same net result.  Now we're consistent.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-02-08 03:36:49 -08:00
Michael Crosby
e345fe53ba Merge pull request #10573 from LK4D4/return_attach_to_builder
Change verbose builder out back to attach
2015-02-06 14:37:09 -08:00
Michael Crosby
34c804a139 Merge pull request #9705 from acbodine/9311-truncindex-error-duplicate-id-on-ambiguous-id
Closes #9311 Handles container id/name collisions against daemon functionalities according to #8069
2015-02-06 14:01:28 -08:00
Tibor Vass
82191cc3f3 Merge pull request #10120 from duglin/TrimSpaces
Remove leading/trailing spaces in builder/parser
2015-02-06 16:25:37 -05:00
Doug Davis
3859c48531 Remove leading/trailing spaces in builder/parser
Per Erikh's suggestion at:
https://github.com/docker/docker/pull/9989#issuecomment-69832009
this PR will trim spaces in the parser to ensure that the user gets the same
results irrespetive of leading/trailing spaces.

Per @tiborvass's suggestion I added a test to make sure spaces in quotes
are not touched.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-02-06 08:52:18 -08:00
Alexander Morozov
1095d5e5e4 Change verbose builder out back to attach
This is sort of "revert" of #8415. There is some problems with using
logs:
* Non-live progressbars
* Races when you can try to get logs before it was written(there was
  occasional errors in tests)

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-02-04 15:37:14 -08:00
Chen Hanxiao
ef3192f161 fix comments typos
s/propogated/propagated

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-02-04 10:47:37 +08:00
Tibor Vass
73d5baf585 builder: prevent Dockerfile to leave build context
Signed-off-by: Tibor Vass <teabee89@gmail.com>
2015-02-02 23:40:24 -08:00
Doug Davis
198ff76de5 Add an API test for docker build -f Dockerfile
I noticed that while we have tests to make sure that people don't
specify a Dockerfile (via -f) that's outside of the build context
when using the docker cli, we don't check on the server side to make
sure that API users have the same check done. This would be a security
risk.

While in there I had to add a new util func for the tests to allow us to
send content to the server that isn't json encoded - in this case a tarball

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-02-02 23:40:20 -08:00
Tibor Vass
70fbd45a5c Merge pull request #10123 from duglin/Issue10097
Build CMD/ENTRYPOINT cache strings properly
2015-01-28 14:43:16 -05:00
Josh Hawn
e662775ffb Fix premature close of build output on pull
The build job will sometimes trigger a pull job when the base image
does not exist. Now that engine jobs properly close their output by default
the pull job would also close the build job's stdout in a cascading close
upon completion of the pull.

This patch corrects this by wrapping the `pull` job's stdout with a
nopCloseWriter which will not close the stdout of the `build` job.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-01-27 10:07:01 -08:00
Andrew C. Bodine
d25a65375c Closes #9311 Handles container id/name collisions against daemon functionalities according to #8069
Signed-off-by: Andrew C. Bodine <acbodine@us.ibm.com>
2015-01-21 17:11:31 -08:00
Tibor Vass
50ff27caa1 Merge pull request #9826 from icecrime/8318_whitespace_add_copy
Support whitespace in paths for ADD and COPY
2015-01-19 18:37:53 -05:00
Doug Davis
88905793ad Build CMD/ENTRYPOINT cache strings properly
Make sure that as we build the CMD/ENTRYPOINT cache strings that we don't
treat ["echo","hi"] and ["echo hi"] as the same thing due to the fact that
we're just doing a strcat on the array.

Closes #10097

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-01-15 12:49:30 -08:00
Jessie Frazelle
640e0fc578 Merge pull request #9881 from tianon/json-array-of-strings
Adjust builder to validate that JSON in Dockerfiles are arrays of strings and nothing else to match how we describe them to people (and what all our existing tests already assumed)
2015-01-14 17:13:51 -08:00
Tibor Vass
3183af8b19 builder: use len() > 0 instead of != nil
Signed-off-by: Tibor Vass <teabee89@gmail.com>
2015-01-14 16:55:56 -08:00
Erik Hollensbe
39343b8618 Fix a panic where RUN [] would be supplied.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2015-01-14 16:55:56 -08:00
Alexander Morozov
99a15ec8bd Merge pull request #9973 from duglin/Issue9880
Make sure that ADD/COPY still populate the cache even if they don't use it
2015-01-13 11:17:34 -08:00
Doug Davis
32cde64c04 Merge pull request #9980 from erikh/parser-with-no-command
Fix a parser error where an empty RUN statement would cause a panic
2015-01-08 19:34:06 -05:00
Don Kjer
568f86eb18 Deprecating ResolveRepositoryName
Passing RepositoryInfo to ResolveAuthConfig, pullRepository, and pushRepository

Moving --registry-mirror configuration to registry config

Created resolve_repository job

Repo names with 'index.docker.io' or 'docker.io' are now synonymous with omitting an index name.

Adding test for RepositoryInfo

Adding tests for opts.StringSetOpts and registry.ValidateMirror

Fixing search term use of repoInfo

Adding integration tests for registry mirror configuration

Normalizing LookupImage image name to match LocalName parsing rules

Normalizing repository LocalName to avoid multiple references to an official image

Removing errorOut use in tests

Removing TODO comment

gofmt changes

golint comments cleanup.  renaming RegistryOptions => registry.Options, and RegistryServiceConfig => registry.ServiceConfig

Splitting out builtins.Registry and registry.NewService calls

Stray whitespace cleanup

Moving integration tests for Mirrors and InsecureRegistries into TestNewIndexInfo unit test

Factoring out ValidateRepositoryName from NewRepositoryInfo

Removing unused IndexServerURL

Allowing json marshaling of ServiceConfig.  Exposing ServiceConfig in /info

Switching to CamelCase for json marshaling

PR cleanup; removing 'Is' prefix from boolean members.  Removing unneeded json tags.

Removing non-cleanup related fix for 'localhost:[port]' in splitReposName

Merge fixes for gh9735

Fixing integration test

Reapplying #9754

Adding comment on config.IndexConfigs use from isSecureIndex

Remove unused error return value from isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>

Adding back comment in isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-01-08 20:14:58 +00:00
Erik Hollensbe
09e3467452 Fix a parser error where an empty RUN statement would cause a panic
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2015-01-08 11:30:08 -08:00
Doug Davis
6f20b957b0 Make sure that ADD/COPY still populate the cache even if they don't use it
Closes #9880

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-01-08 06:56:30 -08:00
Doug Davis
eb3ea3b43c Allow for Dockerfile to be named something else.
Add a check to make sure Dockerfile is in the build context
Add docs and a testcase
Make -f relative to current dir, not build context

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-01-06 16:33:26 -08:00
Doug Davis
6d801a3caa Have .dockerignore support Dockerfile/.dockerignore
If .dockerignore mentions either then the client will send them to the
daemon but the daemon will erase them after the Dockerfile has been parsed
to simulate them never being sent in the first place.

an events test kept failing for me so I tried to fix that too

Closes #8330

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-01-06 10:57:48 -08:00
Tianon Gravi
05c2d2db9a Adjust builder to validate that JSON in Dockerfiles are arrays of strings and nothing else to match how we describe them to people (and what all our existing tests already assumed)
This also adds more tests to help verify this, including unicode and nonprintable characters (hence the earlier commit switching to strconv.Quote).

As a bonus, this fixes a subtle bug where [] was turned into [""] and then turned back into [] (and thus [""] was impossible to actually round-trip correctly in a Dockerfile).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-01-05 14:31:05 -07:00
Doug Davis
04ee071692 Modify MAINTAINERS per erikh's suggestion
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-01-05 10:28:36 -08:00
Tianon Gravi
f6cb1ea85a Simplify builder TestTestData slightly by using ioutil.ReadFile instead of os.Open+ioutil.ReadAll
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-01-02 22:38:52 -07:00
Tianon Gravi
1edf16e977 Simplify builder ast.Dump by using strconv.Quote instead of a custom QuoteString function (the only change to existing files is literal tabs becoming \t, but future files may use nonprintable characters and the like now)
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-01-02 22:36:58 -07:00
Seongyeol Lim
abfb713887 Add support file name with whitespace for ADD and COPY command
Closes #8318

Signed-off-by: Seongyeol Lim <seongyeol37@gmail.com>
2014-12-26 16:28:03 -08:00
Josh Hawn
8936789919 Make FROM scratch a special cased 'no-base' spec
There has been a lot of discussion (issues 4242 and 5262) about making
`FROM scratch` either a special case or making `FROM` optional, implying
starting from an empty file system.

This patch makes the build command `FROM scratch` special cased from now on
and if used does not pull/set the the initial layer of the build to the ancient
image ID (511136ea..) but instead marks the build as having no base image. The
next command in the dockerfile will create an image with a parent image ID of "".
This means every image ever can now use one fewer layer!

This also makes the image name `scratch` a reserved name by the TagStore. You
will not be able to tag an image with this name from now on. If any users
currently have an image tagged as `scratch`, they will still be able to use that
image, but will not be able to tag a new image with that name.

Goodbye '511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158',
it was nice knowing you.

Fixes #4242

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-12-18 14:03:38 -08:00
Doug Davis
f21f9f856e Allow for relative paths on ADD/COPY
Moved Tianon's PR from: https://github.com/docker/docker/pull/7870
on top of the latest code

Closes: #3936

Signed-off-by: Andrew Page <admwiggin@gmail.com>
Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-12-18 05:13:04 -08:00
Arnaud Porterie
a76f7c6ec3 Merge pull request #9122 from dqminh/debug-huge-expose
Expose a large number of ports should not slow down builder
2014-12-16 10:03:31 -08:00
Aleksa Sarai
916cba9c58 builder: internals: fix incomplete chown walk when fixing permissions
This patch fixes the permission fixing code used by addContext, which
would not be responsible for Lchown-ing top-level directories added to a
destination that didn't exist prior to untar-ing the context.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2014-12-12 06:07:16 +11:00
Arnaud Porterie
cfc24769a2 Fix permissions on ADD/COPY
Fix a regression introduced in PR#9467 when a single file was added or
copied.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-10 11:09:03 -08:00
Alexandr Morozov
a62cbdeb47 Use Set for stderr "logs" job in builder
Because engine implicitly adds his stder to job stderr

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-12-09 19:08:24 -08:00
Arnaud Porterie
f3cedce360 Reduce permissions changes scope after ADD/COPY
Permissions after an ADD or COPY build instructions are now restricted
to the scope of files potentially modified by the operation rather than
the entire impacted tree.

Fixes #9401.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-04 17:16:22 -08:00
Tibor Vass
e6ec703df3 Merge pull request #9323 from unclejack/merge_release_v1.3.2
Merge release v1.3.2 to master
2014-11-24 19:26:36 -05:00
Michael Crosby
5794b5373e Update code for use of urlutil pkg
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-24 18:47:42 -05:00
Tibor Vass
9c01bc249d pkg/chrootarchive: pass TarOptions via CLI arg
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Conflicts:
	graph/load.go
		fixed conflict in imports
2014-11-25 01:03:40 +02:00
unclejack
1cb17f03d0 add pkg/chrootarchive and use it on the daemon
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)

Conflicts:
	builder/internals.go
	daemon/graphdriver/aufs/aufs.go
	daemon/volumes.go
		fixed conflicts in imports
2014-11-25 01:03:40 +02:00
unclejack
054e57a622 build: add pull flag to force image pulling
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2014-11-21 19:59:44 +02:00
Doug Davis
1314e1586f Add support for ENV of the form: ENV name=value ...
still supports the old form: ENV name value

Also, fixed an issue with the parser where it would ignore lines
at the end of the Dockerfile that ended with \

Closes #2333

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-20 09:54:28 -08:00
John Gossman
e45b0f9271 Remove unused sysinfo parameter to runconfig.Parse
Removing dead code.

Signed-off-by: John Gossman <johngos@microsoft.com>
2014-11-14 18:20:54 -08:00
Hans Rødtang
b4336803f3 Updated cover tool import path.
Signed-off-by: Hans Rødtang <hansrodtang@gmail.com>
2014-11-14 06:16:41 +01:00
Daniel, Dao Quang Minh
87d0562c61 expose sorts its ports before saving as comment
Saving ports as `map[nat.Port]struct{}` directly has ordering issue which is
more replicatable where we expose a huge number of ports at the same time. As a
result, the cache will be burst whenever the map order is different from the
previous build.
This sorts the ports first and save them as a whitespace-separated list instead
of the map representation, so the order will always be consistent if the port
list isnt changed.

NOTICE: this will burst the old expose caches

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-11-12 09:14:35 -05:00
Daniel, Dao Quang Minh
3aae63f452 speed up creation of args and msg for huge cmds
Whenever a command arguments is formed by a large linked list, repeatedly
appending to arguments and displayed messages took a long time because go will
have to allocate/copy a lot of times.

This speeds up the allocation by preallocate arrays of correct size for args
and msg

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-11-12 00:04:45 -05:00
Erik Hollensbe
0b4132782a Merge pull request #9048 from coaku/b_xzk_rm_redundant_trim
Remove redundant stripComment
2014-11-10 21:53:22 -08:00
xuzhaokui
6c79ee7d1e Remove the redundant stripComment.
Signed-off-by: xuzhaokui <cynicholas@gmail.com>
2014-11-09 23:07:44 +08:00
Doug Davis
2e482c86bc Use the HTTP Last-Modified http header as the mtime value for ADD cmd when present
Closes #8331

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-07 13:58:05 -08:00
Jessie Frazelle
9cc71b4597 Merge pull request #8468 from laktek/master
Fix URL check in build from Git.
2014-10-31 14:43:21 -07:00
Erik Hollensbe
24545c18c3 builder: Restore /bin/sh handling in CMD when entrypoint is specified with JSON
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-27 21:50:22 +00:00
Erik Hollensbe
4e74cd498b builder: whitelist verbs useful for environment replacement.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-27 17:38:25 +00:00
Erik Hollensbe
be49867cab builder: handle escapes without swallowing all of them.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-27 17:38:24 +00:00
Jessie Frazelle
15b6b7be01 Merge pull request #8770 from LK4D4/logrus_support
Logrus support
2014-10-27 09:05:24 -07:00
Lakshan Perera
d3ac9ea98e Add HasValidGITPrefix to utils/utils.go
This will allow us to use a common Git prefix check for both api/clients/commands.go and
builder/job.go. Previous prefix check in build from Git (in builder/jobs.go) ignored valid prefixes such as "git@", "http://" or "https://".

Signed-off-by: Lakshan Perera <lakshan@laktek.com>
2014-10-26 03:25:25 +00:00
Alexandr Morozov
7c62cee51e Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-24 15:03:06 -07:00
Erik Hollensbe
cdd6e97910 builder: some small fixups + fix a bug where empty entrypoints would not override inheritance.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-24 00:23:25 +00:00
Sven Dowideit
bb3e33154d Merge pull request #8673 from SvenDowideit/whats-docker-version
DOCKER_VERSION and docker-version havn't been implemented.
2014-10-22 19:03:54 -07:00
Erik Hollensbe
a34831f016 builder: handle cases where onbuild is not uppercase.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-21 20:17:37 +00:00
Sven Dowideit
6ed610fb80 DOCKER_VERSION and docker-version havn't been implemented.
So far, it looks like the declarations are not used, and so its safer not to
confuse people into thinking they do something.

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
2014-10-21 16:04:11 +10:00
Michael Crosby
b90ab68f2a Merge pull request #8511 from coolljt0725/fix_tag
Fix tag an existed tag name of a repository
2014-10-20 14:32:23 -07:00
Alexandr Morozov
75fd1b614d Merge pull request #8639 from erikh/fix_escapes
builder: fix escaping for ENV variables.
2014-10-17 15:50:37 -07:00
Erik Hollensbe
df0e0c7683 builder: fix escaping for ENV variables.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-17 21:47:35 +00:00
Alexandr Morozov
6f09d064bd Use logs instead of attach for builder
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 13:20:02 -07:00
Michael Crosby
9a82713772 Merge pull request #8578 from erikh/fix_slash
builder: Handle trailing \ appropriately.
2014-10-15 12:11:37 -07:00
Alexandr Morozov
abec82bdee Merge pull request #8579 from erikh/builder_html_panic
builder: handle anything we cannot parse the command for as a fatal error
2014-10-15 12:01:52 -07:00
Erik Hollensbe
3f2eb353bd builder: provide a friendly message on parser errors
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-15 18:08:23 +00:00
Erik Hollensbe
63637b9d27 builder: handle anything we cannot parse the command for as a fatal error.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-15 08:47:15 +00:00
Erik Hollensbe
96f342f703 builder: comments should also be elided in the middle of statements following a line continuation.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-15 08:44:14 +00:00
Erik Hollensbe
a1ef2207dd builder: strip blank lines before processing any line continuations.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-15 04:00:17 +00:00
Erik Hollensbe
7fa449191c builder: Handle trailing \ appropriately.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-15 03:08:18 +00:00
Tianon Gravi
24189b2c36 Fix builder from being over-aggressive on ${}
`${SOME_VAR%pattern}` was turning into `SOME_VAL%pattern}` which the shell would then balk at.

I've updated the `TOKEN_ENV_INTERPOLATION` regex to account for this (ie, if `${` is used, it _must_ also match the closing `}`), and renamed the variable to not be exported (since it's not used outside the function following it).

I also added comments for the bits of `tokenEnvInterpolation` so they're easier to follow. 😄

Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-10-14 00:58:55 -06:00
Erik Hollensbe
1150c1639a builder: ONBUILD triggers were not accurately being executed in JSON cases.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-14 01:59:45 +00:00
Lei Jitang
5e6f16e342 Fix the bug of tag a existed tag name of a repository.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2014-10-10 09:18:12 +08:00
Michael Crosby
50fa9dffcf Allow child to overwrite entrypoint from parent
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-10-07 23:45:35 +00:00
Tibor Vass
0a2c481c7f ignore invalid Dockerfile instructions and do not consider "docker-version" a Dockerfile instruction
Signed-off-by: Tibor Vass <teabee89@gmail.com>
2014-10-06 23:26:59 -04:00
Victor Vieux
7bd482d570 Merge pull request #8370 from duglin/ParserIndent
Fix builder/parser so it keeps some whitespace on split lines.
2014-10-06 10:32:02 -07:00
Doug Davis
f440c6b224 Fix builder/parser so it keeps some whitespace on split lines.
If previous line ends with whitespace, or next line starts with whitepsace
we need to preserve a space otherwise things line:
RUN echo\
   hello
will appear as: RUN echohello

Noticed this while looking at #5744 because he had lines ending in &&\

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-10-03 20:33:12 -07:00
Joffrey F
aabba9801a Added validity checks for repo name and tag in build job.
Signed-off-by: Joffrey F <joffrey@docker.com>
2014-10-02 17:37:13 +02:00
Rafe Colton
30d5a42c1f Move archive package into pkg/archive
Now that the archive package does not depend on any docker-specific
packages, only those in pkg and vendor, it can be safely moved into pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
2014-09-29 23:23:36 -07:00
Rafe Colton
b845a62149 Move Go() promise-like func from utils to pkg/promise
This is the first of two steps to break the archive package's dependence
on utils so that archive may be moved into pkg.  Also, the `Go()`
function is small, concise, and not specific to the docker internals, so
it is a good candidate for pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
2014-09-29 23:16:27 -07:00
Tibor Vass
670c8696a2 Merge pull request #8284 from erikh/fix_cmd_again
builder: Fix CMD to inject /bin/sh -c when provided with a non-json value
2014-09-29 15:56:16 -04:00
Erik Hollensbe
9f142bf9be builder: Fix CMD to inject /bin/sh -c when provided with a non-json value.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-29 12:22:18 -07:00
Erik Hollensbe
1cd6135972 Merge pull request #8230 from duglin/Issue6820
add wildcard support to COPY/ADD (part 2 of issue #6820)
2014-09-29 11:19:01 -07:00
Doug Davis
acd40d5079 add wildcard support to copy/add
Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-09-25 20:44:51 -07:00
Andrea Luzzardi
1df87b9506 API: Provide the HostConfig during "run".
Currently, the HostConfig is only passed from the CLI to Docker only
when issuing a docker create, but not when doing a docker run.

In the near future, in order to allocate ports at creation time rather
than start time, we will need to have the HostConfig readily available
at container creation.

This PR makes the client always pass the HostConfig when creating a
container (regardless of whether it's for a run or create).

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-09-25 15:24:38 -07:00
Tibor Vass
d369612b41 Merge pull request #7994 from erikh/parser_fix_volume_parsing
builder: Fix handling of VOLUME command where multiple volumes are specified in a space delimited list.
2014-09-25 12:45:48 -04:00
Erik Hollensbe
a5ca549a18 builder: Fix handling of VOLUME command where multiple volumes are
specified in a space delimited list.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-25 09:44:19 -07:00
Victor Vieux
81a643211b Merge pull request #8186 from duglin/ErrInCopyCache
Make sure COPY/ADD on dirs doesn't grab too many files
2014-09-23 15:16:57 -07:00
Doug Davis
cd329d062b Make sure COPY/ADD on dirs doesn't grab too many files
Add check for / first - per LK4D4's comment.
Add a comment to explain why we're adding a /

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-09-23 14:16:00 -07:00
Erik Hollensbe
8edacc673a builder: properly communicate onbuild trigger information during
subsequent builds.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-23 13:55:51 -07:00
Erik Hollensbe
1e93639aed builder: Appropriately initialize the Cmd in runconfig.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-22 23:10:05 -07:00
Brian Goff
45407cf00a Split volumes out from daemon
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-09-19 17:47:47 -05:00
Doug Davis
05b8a1eb36 Add support for copy/add with multiple src files
Part one of solution for issue #6820

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-09-18 20:12:13 -07:00
Michael Crosby
f8be5f586f Merge pull request #8097 from erikh/builder_maintainers
Add a new MAINTAINERS file for the builder.
2014-09-17 15:42:34 -07:00
Erik Hollensbe
1ff1befd12 Add a new MAINTAINERS file for the builder.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-17 15:36:04 -07:00
Oh Jinkyun
9aa71549d6 Removed runconfig.ParseSubcommand
Removed runconfig.ParseSubcommand, changed it to runconfig.Parse and editted related tests and modules

Signed-off-by: Oh Jinkyun <tintypemolly@gmail.com>
2014-09-17 14:38:22 -07:00
Vincent Batts
c5e6362c53 tarsum: name collision fix
If a tar were constructed with duplicate file names, then depending on
the order, it could result in same tarsum.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-17 14:37:46 -04:00
Alexandr Morozov
00fd008170 Merge pull request #8062 from vishh/run_in_phase2
Add support for 'docker exec' - phase 2
2014-09-16 23:56:12 +04:00
Phil Estes
4119c9d7d9 Refactor all pre-compiled regexp to package level vars
Addresses #8057

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2014-09-16 12:57:44 -04:00
Vishnu Kannan
5130fe5d38 Adding support for docker exec in daemon.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 16:57:52 +00:00
Vishnu Kannan
f3c767d798 Adding Exec method to native execdriver.
Modified Attach() method to support docker exec.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 16:57:52 +00:00
unclejack
31c0039022 clean up the context when a build fails
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-15 16:01:23 +03:00
Tibor Vass
23f490427f Merge pull request #7983 from vbatts/vbatts-tarsum_switch_names
tarsum: TarSum should be the interface
2014-09-12 17:01:35 -04:00
Erik Hollensbe
91bed43621 builder: Fix an error check being done at the wrong spot in run
dispatcher

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-11 06:00:24 -07:00
Erik Hollensbe
92f885d7bd Do not populate path to prevent runconfig merge conflict; remove
autoConfig seeding of entrypoint.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-11 06:00:24 -07:00
Erik Hollensbe
78a847a47a evaluator: ensure entrypoint stays blank if set blank while CMD is set.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-11 06:00:24 -07:00
Erik Hollensbe
ac107995ae builder: Fix entrypoint and cmd semantics in evaluator. Test c/o @cnf
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-11 06:00:24 -07:00
Erik Hollensbe
3a6d1228a8 builder: Fix a small bug that could improperly cache.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-11 06:00:24 -07:00
Erik Hollensbe
6b322ad2d3 builder/parser: fix handling of empty strings as the only argument.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-11 06:00:24 -07:00
Erik Hollensbe
234f0e4f79 builder/parser/dumper: Handle newlines appropriately.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-11 06:00:24 -07:00
Vincent Batts
ec01eb653d tarsum: TarSum is not the interface
don't export the exsisting TarSum struct and call the interface 'TarSum'
instead.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-10 21:56:20 -04:00
Vincent Batts
747f89cd32 TarSum: versioning
This introduces Versions for TarSum checksums.
Fixes: https://github.com/docker/docker/issues/7526

It preserves current functionality and abstracts the interface for
future flexibility of hashing algorithms. As a POC, the VersionDev
Tarsum does not include the mtime in the checksum calculation, and would
solve https://github.com/docker/docker/issues/7387 though this is not a
settled Version is subject to change until a version number is assigned.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-10 15:41:52 -04:00
Michael Crosby
85314e7e58 Merge pull request #7759 from unclejack/pull_latest_by_default
make docker pull only the latest tag by default
2014-09-08 13:43:21 -07:00
Alexandr Morozov
f17410da5e Fix race between dispatchers.run and toDisk
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-04 19:43:28 +04:00
unclejack
6ba5d67a51 docker build: pull just latest if tag uspecified
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-03 18:32:47 +03:00
Victor Vieux
4e40d09a2b Add a progress bar for ADD <url> <dst>
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-09-03 00:17:08 +00:00
Jessie Frazelle
f74b901da6 Merge pull request #7839 from LK4D4/embed_state_to_container
Use State as embedded to Container
2014-09-02 15:18:32 -07:00
Alexandr Morozov
e0339d4b88
Use State as embedded to Container
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-03 00:01:11 +04:00
unclejack
1858746978 clean up context on build completion & add test
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-02 17:35:25 +03:00
Erik Hollensbe
a0255ba502 Fix panic when ENV ARG=ARG is used.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-31 05:39:36 -07:00
Erik Hollensbe
2ef1dec7e8 builder: Refactors according to @tiborvass's comments
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
305f735080 builder: several fixups from comments
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
a1522ec01c builder: move the evaluator package code directly into builder
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
cb51681a6d builder: Fix handling of ENV references that reference themselves, plus tests.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
1ae4c00a19 builder: fix references to jobs in daemon, make builder a first class
package referring to evaluator

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
3dfe5ddfb9 builder: Remove spurious .gitignores
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
248f4c4f75 builder/parser: Rewrite Parse() to use := instead of var
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
135f54ccbf builder: Remove blankNode(), use &Node{} instead.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
21b15ac920 builder: handle certain classes of JSON errors gracefully
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
4122a981ae builder: negative test support, fix for shykes's broken dockerfile
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
3f5f6b038f builder: comments / documentation
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
d6c0bbc3cb builder: add command handling to evaluator.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Erik Hollensbe
bb36902db6 builder: rewrote NewBuildFile according to tibor's comments
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:29 -07:00
Erik Hollensbe
22c46af4b3 builder: parser and beginnings of the evaluator
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:29 -07:00