cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
125
Views
5
Helpful
1
Replies
Highlighted
Cisco Employee

Docker build error: /bin/bash^M: bad interpreter: No such file or directory

I'm getting the following error docker-building the Dockerfile from Windows:

 

 

#9 [ 5/16] RUN /bin/bash -c './test/dependencies_ubuntu.sh && ./test/dependencies_linux_gnmi.sh'
#9 sha256:8b9ed68beb18e3eb3c3725b071bd8344ede679ae5597649a527ed9e03b169f21
#9 0.326 /bin/bash: ./test/dependencies_ubuntu.sh: /bin/bash^M: bad interpreter: No such file or directory
#9 ERROR: executor failed running [/bin/sh -c /bin/bash -c './test/dependencies_ubuntu.sh && ./test/dependencies_linux_gnmi.sh']: exit code: 126
------
 > [ 5/16] RUN /bin/bash -c './test/dependencies_ubuntu.sh && ./test/dependencies_linux_gnmi.sh':
------
executor failed running [/bin/sh -c /bin/bash -c './test/dependencies_ubuntu.sh && ./test/dependencies_linux_gnmi.sh']: exit code: 126

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

I found this change into Dockerfile to solve the issue:

diff --git a/Dockerfile b/Dockerfile
index e6727ce3..dd2e9ad1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -7,7 +7,8 @@ COPY . /root/ydk-gen
 RUN echo 'Installing dependencies'

 WORKDIR /root/ydk-gen
-
+RUN sed -i -e 's/\r$//' test/dependencies_ubuntu.sh
+RUN sed -i -e 's/\r$//' test/dependencies_linux_gnmi.sh
 RUN /bin/bash -c './test/dependencies_ubuntu.sh && ./test/dependencies_linux_gnmi.sh'

 RUN pip3 install -r requirements.txt

View solution in original post

1 REPLY 1
Highlighted
Cisco Employee

I found this change into Dockerfile to solve the issue:

diff --git a/Dockerfile b/Dockerfile
index e6727ce3..dd2e9ad1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -7,7 +7,8 @@ COPY . /root/ydk-gen
 RUN echo 'Installing dependencies'

 WORKDIR /root/ydk-gen
-
+RUN sed -i -e 's/\r$//' test/dependencies_ubuntu.sh
+RUN sed -i -e 's/\r$//' test/dependencies_linux_gnmi.sh
 RUN /bin/bash -c './test/dependencies_ubuntu.sh && ./test/dependencies_linux_gnmi.sh'

 RUN pip3 install -r requirements.txt

View solution in original post

Content for Community-Ad