i have the following Dockerfile:
FROM debian:stretch-backports
MAINTAINER c33s
ARG DEBIAN_FRONTEND=noninteractive
COPY provision-base.sh /root/provision-base.sh
RUN chmod +x /root/provision-base.sh && /root/provision-base.sh
why do i get the following error running it:
...snip...
/root/provision-base.sh: 1: /root/provision-base.sh: #!/bin/bash: not found
...snip...
RUN ls /root/provision-base.sh shows itRUN which bash also shows that bash is installedbuild log on dockerhub:https://hub.docker.com/r/c33s/debian/builds/bd6g8cqr2rtys9a2gguehcw/ (snip of the build log also on pastebin https://pastebin.com/6x1UK53H)
Bash is often in different places on different systems. Often at /bin/bash, but on this container it's located here:
% docker run -it debian:stretch-backports
root@bb01a3db779e:/# type bash
bash is /usr/bin/bash
The env command is more predictable, and can be used to locate other programs in the shebang line. So try this in your script:
#!/usr/bin/env bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With