What if "apt-get" becomes an instruction?
See original GitHub issueInside a multi-line RUN instruction, lack of \
will lead missing of command and no exception will be raised.
Here is an example Dockerfile
FROM ubuntu:xenial
RUN apt-get install -y curl && \
curl --silent --location https://deb.nodesource.com/setup_4.x | bash - && \
apt-get install -y nodejs
apt-get install -y build-essentials
echo Hello
Now, echo
is taken as an instruction, but apt-get
is lost.
If apt-get
can also be taken as an instruction, I can deal with this Dockerfile syntax error manually.
If not, an exception is expected.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Why does apt-get abort by itself, as though I'd pressed 'N'?
apt -get aborts when it wants interactive confirmation but can't read input from stdin. For example, anyone (with pending upgrades) can reproduce this ......
Read more >APT-GET Command in Linux {Detailed Tutorial With Examples}
apt -get is a command line tool for interacting with the Advanced Package Tool (APT) library (a package management system for Linux distributions) ......
Read more >Can I rollback an apt-get upgrade if something goes wrong?
Thus the need for a rollback. The short answer - you could use the following command: $ apt-get -s install $(apt-history rollback |...
Read more >AptGet/Howto - Community Help Wiki
This command runs <command_string> under the control of auto-apt. If a program tries to access a file known to belong in an uninstalled...
Read more >Apt-get not working within ubuntu dockerfile - Stack Overflow
Execute 'apt-get update' and 'apt-get install' in a single RUN instruction. This is done to make sure that the latest packages will be ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue may be related to https://github.com/containerbuildsystem/dockerfile-parse/blob/47740325fb821af04c4c94cd4d59701cbcd3f194/dockerfile_parse/parser.py#L243
as
apt-get
does not match^\s*(\w+)\s
.How about replace the regex with
r'^\s*(\S+)\s+(.*)$'
? In this way, Dockerfile error is left for the user to deal with.That’s possible, at least all new code must pass flake8 testing, we have enabled stickler-CI to cover new things.
Fixed via #92