Docker Community Forums

Share and learn in the Docker community.

Sed: no input files


I’m trying to build certain images in these lines of code:

RUN cd /Image-Comparator/
RUN grep -rl DB1 /Image-Comparator/* | xargs sed -i ‘s/ret_images/DB1/g’
RUN grep -rl /Image-Comparator/* | xargs sed -i ‘s/’
RUN grep -rl “5984” /Image-Comparator/* | xargs sed -i ‘s/5984/<database_port>/g’

However, I tried running the following command:
docker build . -t db1:

But I got this error message:
Step 17/19 : RUN grep -rl /Image-Comparator/* | xargs sed -i ‘s/’
—> Running in 7a0bc01ea9cf
sed: no input files
The command ‘/bin/sh -c grep -rl /Image-Comparator/* | xargs sed -i ‘s/’’ returned a non-zero code: 123

Any help is much appreciated. Thanks.

I would suggest, writing these as a script. Then do a COPY of script into container, then do a RUN on the script.
Then add some good logging of the data that is returned before the sed command…