Commit Graph

9 Commits

Author SHA1 Message Date
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
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
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
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
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
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 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 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