Commit Graph

10 Commits

Author SHA1 Message Date
d887efe03f 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>
Upstream-commit: a8e871b0bbbb63310f372332176875ffcc01aaf6
Component: engine
2015-04-28 05:28:46 -07:00
d3182181ac 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>
Upstream-commit: e4f02abb51534e560311b0afcfb7b586d9587e67
Component: engine
2015-02-08 03:36:49 -08:00
7b03f17d1a 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>
Upstream-commit: 3859c485317a395de1e8eb48270d0e3b1207a204
Component: engine
2015-02-06 08:52:18 -08:00
d0cdce5ce4 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>
Upstream-commit: 1edf16e977a3dd18f9ff15b4acf40b0c1ac64788
Component: engine
2015-01-02 22:36:58 -07:00
7e0088079e builder: provide a friendly message on parser errors
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 3f2eb353bdbb36ce26690909bcf761d4289294d6
Component: engine
2014-10-15 18:08:23 +00:00
4a6aadc8cd 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)
Upstream-commit: 63637b9d277d322a06f24e3195fab48bc2a705d6
Component: engine
2014-10-15 08:47:15 +00:00
94f1cd5e88 ignore invalid Dockerfile instructions and do not consider "docker-version" a Dockerfile instruction
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 0a2c481c7f24fcd295b1e1f6504732971b289919
Component: engine
2014-10-06 23:26:59 -04:00
e5b50b40c8 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)
Upstream-commit: cb51681a6db4b7c62d91998ba3b1d3b98c09c61c
Component: engine
2014-08-27 18:52:30 -07:00
8d44d56320 builder: add command handling to evaluator.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: d6c0bbc3cbf9204c506fedf4d0c5a477c7559a1d
Component: engine
2014-08-27 18:52:30 -07:00
68301c3828 builder: parser and beginnings of the evaluator
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 22c46af4b358cf3ec4f7af47c701064c00cf7de4
Component: engine
2014-08-27 18:52:29 -07:00