Note that the error message says that wget, is not found - note the trailing comma. You’ve mixed up the “shell form” and “exec form” of the RUN command.
The “exec form” of the RUN command uses a comma-separated list of double-quoted strings wrapped in square brackets. This is identical to the syntax for JSON arrays. This form looks like this:
RUN ["wget", "http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz"]
In exec form, the array is used to directly execute the target program with the given arguments.
The shell form, on the other hand, consists simply of the command as if it were typed in at a shell prompt, and is distinguished from the exec form by the lack of square brackets. In shell form, the entire remainder of the line is passed to the shell as /bin/sh -c <command> (note that the command is passed as a single argument, even if it contains spaces). This therefore executes the remainder of the line as a shell command, allowing you to freely use shell variables, expansions, redirections, etc.
In your case, you’ve specified your RUN command as follows:
RUN "wget", "http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz"
Because the command doesn’t start with a square bracket, this will be interpreted as a shell form command and executed through the shell. The shell will parse and discard the double quotes, resulting in the command
wget, http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz
The trailing comma results in the command not being found.
To fix, either use standard exec form by adding square brackets, as above, or use standard shell form:
RUN wget 'http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz'
(Note single quotes, which are generally good practice when passing arbitrary URLs through the shell).
returned a non-zero code: 139in a CentOS 7 server. I have solved my problem just uninstalling and reinstalling docker again.sudo yum remove docker.x86_64 docker-common.x86_64 docker-distribution.x86_64 docker-rhel-push-plugin.x86_64sudo yum remove docker.x86_64 docker-common.x86_64 docker-distribution.x86_64 docker-rhel-push-plugin.x86_64