Many thanks @nic
Here is a version with no external file
RUN mv /bin/uname /bin/uname.orig RUN printf '#!/bin/bash\n\nif [[ "$1" == "-r" ]] ;then\n echo '4.9.250'\n exit\nelse\n uname.orig "$@"\nfi' > /bin/uname RUN chmod 755 /bin/uname
(The second statement should be all on one line if you copy-paste it)
Many thanks @nic
Here is a version with no external file
RUN mv /bin/uname /bin/uname.orig
RUN printf '#!/bin/bash\n\nif [[ "$1" == "-r" ]] ;then\n echo '4.9.250'\n exit\nelse\n uname.orig "$@"\nfi' > /bin/uname
RUN chmod 755 /bin/uname
(The second statement should be all on one line if you copy-paste it)