Issue
I've create a simple vim distro and I install it manually in my local computer or inside a docker using a command like the following:
bash <(wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh)
This script works. But I want to execute it also inside a Dockerfile. Trying to simply add:
RUN bash <(wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh)
I got
=> ERROR [ 9/10] RUN bash <(wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh) 0.3s
------
> [ 9/10] RUN bash <(wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh):
#12 0.321 /bin/sh: 1: Syntax error: "(" unexpected
------
executor failed running [/bin/sh -c bash <(wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh)]: exit code: 2
ERROR: Service 'php' failed to build : Build failed
make: *** [recreate] Error 1
Then I though to add \
before (
.
RUN bash <\(wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh\)
The new error is
=> ERROR [ 9/10] RUN bash <(wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh) 0.3s
------
> [ 9/10] RUN bash <(wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh):
#12 0.310 /bin/sh: 1: cannot open (wget: No such file
Other question (and answer) in stackoverflow does not helping me.
Solution
RUN
executes the command using sh
, but process substitution with <(
is a bash
extension.
Use an ordinary pipe
RUN wget -qO- https://raw.githubusercontent.com/sensorario/newdots/master/install.sh | bash
Answered By - Barmar