When I try to install a bin file manually inside a ubuntu Docker container it works perfectly,
./MyBinfile.bin
but when I try it from my Dockerfile I always get the error : The command '/bin/sh -c chmod +x /tmp/snapcenter_linux_host_plugin.bin && ./tmp/MyBinFile.bin' returned a non-zero code: 1
My Dockerfile looks like :
FROM debian:jessie
RUN apt-get update && apt-get install -y openjdk-7-jdk
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
RUN echo $JAVA_HOME
COPY MyBinFile.bin /tmp/MyBinFile.bin
RUN chmod +x /tmp/MyBinFile.bin && ./tmp/MyBinFile.bin
Can anyone help me in this case?
You copied MyBinFile.bin to /tmp/MyBinFile.bin. Those are not the same file. If you need to run it use absolute path for the file that has executable attribute on it. So your last line should be:
'.' (dot) represents your current current working directory. It's recommended to always use absolute paths if you're unsure what is your cwd.
EDIT
Running your Dockerfile produces the following output:
But if I separate your last step into two different steps:
then it executes OK.