ot4i / iib-docker

Eclipse Public License 1.0
62 stars 115 forks source link

/tmp/kernel_settings.sh: not found Docker 1.10.3 / OSX and WIN7 #17

Closed dennisseidel closed 8 years ago

dennisseidel commented 8 years ago

Hi everyone,

I have the following error after cloning the project and running 'docker build -t iib10v4 .' under Docker version 1.10.3 on OSX and WIN7. Any suggestions? Thanks!

Step 7 : COPY kernel_settings.sh /tmp/
 ---> c923d36480a4
Removing intermediate container fa15c7540018
Step 8 : RUN echo "IIB_10:" > /etc/debian_chroot  &&     touch /var/log/syslog &&     chown syslog:adm /var/log/syslog &&     chmod +x /tmp/kernel_settings.sh;sync &&     /tmp/kernel_settings.sh
 ---> Running in 7bcbfa166e46
/bin/sh: 1: /tmp/kernel_settings.sh: not found
The command '/bin/sh -c echo "IIB_10:" > /etc/debian_chroot  &&     touch /var/log/syslog &&     chown syslog:adm /var/log/syslog &&     chmod +x /tmp/kernel_settings.sh;sync &&     /tmp/kernel_settings.sh' returned a non-zero code: 127

Best Regards Dennis

rmey commented 8 years ago

I don't have this problem. I have Docker version 1.10.2.

dennisseidel commented 8 years ago

It seems it isl the last part of the command ' /tmp/kernel_settings.sh':

/bin/sh: 1: /tmp/kernel_settings.sh: not found
The command '/bin/sh -c /tmp/kernel_settings.sh' returned a non-zero code: 127

I made sure by doing an ls right before and after the move of the kernel_settings.sh file that the file is /tmp and it is. And also the error code says that /bin/sh cannot execute the file.

The solution for me was to modify the script so it explicitly uses bash and not sh! see the code below:

# Configure system
COPY kernel_settings.sh /tmp/
RUN echo "IIB_10:" > /etc/debian_chroot  && \
    touch /var/log/syslog && \
    chown syslog:adm /var/log/syslog && \
    chmod +x /tmp/kernel_settings.sh;sync && \
    bash /tmp/kernel_settings.sh

Then it goes through, only some smaller errors that do not seem to matter as those are empty lines:

/tmp/kernel_settings.sh: line 8: $'\r': command not found
/tmp/kernel_settings.sh: line 21: $'\r': command not found

Still very strange why it cannot do /bin/sh I did an ls to the directory and /bin/sh is there.

dennisseidel commented 8 years ago

Ok, I clean my environment.

So everything is ok now.