Skip to main content
Bumped by Community user

I am trying to dockerize a cpp application and after i build the image in docker and run it i get an error.

Error:
/bin/sh: 1:home/simple/Main: not found

main.cpp

 #include<iostream>

 int main(){
 std::cout<<"Hellow World";
 return 0;
 }
#include<iostream>

int main(){
std::cout<<"Hellow World";
return 0;
}

I compile this with : `g++ -o Main main.cpp`

Dockerfile

FROM ubuntu:latest
RUN mkdir -p /home/simple
COPY . /home/simple
CMD home/simple/Main
FROM ubuntu:latest
RUN mkdir -p /home/simple
COPY . /home/simple
CMD home/simple/Main

Docker commands
docker build -t myapp .
docker run myapp

P.S I have followed this guide :https://www.youtube.com/watch?v=kejsVBoP4kE

How can it not find the executable since it it is in the same folder with the Dockerfile.When i run COPY . /home/simple could it somehow happen to copy only 1/2 of the files?

P.S.2 After setting the ENTRYPOINT ["ls","-l","/home/simple/"] the returned files were 0.
It seems that the ADD/COPY . /home/simple/ does not work.No files are copied.

I am trying to dockerize a cpp application and after i build the image in docker and run it i get an error.

Error:
/bin/sh: 1:home/simple/Main: not found

main.cpp

 #include<iostream>

 int main(){
 std::cout<<"Hellow World";
 return 0;
 }

I compile this with : `g++ -o Main main.cpp`

Dockerfile

FROM ubuntu:latest
RUN mkdir -p /home/simple
COPY . /home/simple
CMD home/simple/Main

Docker commands
docker build -t myapp .
docker run myapp

P.S I have followed this guide :https://www.youtube.com/watch?v=kejsVBoP4kE

How can it not find the executable since it it is in the same folder with the Dockerfile.When i run COPY . /home/simple could it somehow happen to copy only 1/2 of the files?

P.S.2 After setting the ENTRYPOINT ["ls","-l","/home/simple/"] the returned files were 0.
It seems that the ADD/COPY . /home/simple/ does not work.No files are copied.

I am trying to dockerize a cpp application and after i build the image in docker and run it i get an error.

Error:
/bin/sh: 1:home/simple/Main: not found

main.cpp

#include<iostream>

int main(){
std::cout<<"Hellow World";
return 0;
}

I compile this with : `g++ -o Main main.cpp`

Dockerfile

FROM ubuntu:latest
RUN mkdir -p /home/simple
COPY . /home/simple
CMD home/simple/Main

Docker commands
docker build -t myapp .
docker run myapp

P.S I have followed this guide :https://www.youtube.com/watch?v=kejsVBoP4kE

How can it not find the executable since it it is in the same folder with the Dockerfile.When i run COPY . /home/simple could it somehow happen to copy only 1/2 of the files?

P.S.2 After setting the ENTRYPOINT ["ls","-l","/home/simple/"] the returned files were 0.
It seems that the ADD/COPY . /home/simple/ does not work.No files are copied.

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 185 characters in body
Source Link

I am trying to dockerize a cpp application and after i build the image in docker and run it i get an error.

Error:
/bin/sh: 1:home/simple/Main: not found

main.cpp

 #include<iostream>

 int main(){
 std::cout<<"Hellow World";
 return 0;
 }

I compile this with : `g++ -o Main main.cpp`

Dockerfile

FROM ubuntu:latest
RUN mkdir -p /home/simple
COPY . /home/simple
CMD home/simple/Main

Docker commands
docker build -t myapp .
docker run myapp

P.S I have followed this guide :https://www.youtube.com/watch?v=kejsVBoP4kE

How can it not find the executable since it it is in the same folder with the Dockerfile.When i run COPY . /home/simple could it somehow happen to copy only 1/2 of the files?

P.S.2 After setting the ENTRYPOINT ["ls","-l","/home/simple/"] the returned files were 0.
It seems that the ADD/COPY . /home/simple/ does not work.No files are copied.

I am trying to dockerize a cpp application and after i build the image in docker and run it i get an error.

Error:
/bin/sh: 1:home/simple/Main: not found

main.cpp

 #include<iostream>

 int main(){
 std::cout<<"Hellow World";
 return 0;
 }

I compile this with : `g++ -o Main main.cpp`

Dockerfile

FROM ubuntu:latest
RUN mkdir -p /home/simple
COPY . /home/simple
CMD home/simple/Main

Docker commands
docker build -t myapp .
docker run myapp

P.S I have followed this guide :https://www.youtube.com/watch?v=kejsVBoP4kE

How can it not find the executable since it it is in the same folder with the Dockerfile.When i run COPY . /home/simple could it somehow happen to copy only 1/2 of the files?

I am trying to dockerize a cpp application and after i build the image in docker and run it i get an error.

Error:
/bin/sh: 1:home/simple/Main: not found

main.cpp

 #include<iostream>

 int main(){
 std::cout<<"Hellow World";
 return 0;
 }

I compile this with : `g++ -o Main main.cpp`

Dockerfile

FROM ubuntu:latest
RUN mkdir -p /home/simple
COPY . /home/simple
CMD home/simple/Main

Docker commands
docker build -t myapp .
docker run myapp

P.S I have followed this guide :https://www.youtube.com/watch?v=kejsVBoP4kE

How can it not find the executable since it it is in the same folder with the Dockerfile.When i run COPY . /home/simple could it somehow happen to copy only 1/2 of the files?

P.S.2 After setting the ENTRYPOINT ["ls","-l","/home/simple/"] the returned files were 0.
It seems that the ADD/COPY . /home/simple/ does not work.No files are copied.

Source Link

Executable not found when running docker container

I am trying to dockerize a cpp application and after i build the image in docker and run it i get an error.

Error:
/bin/sh: 1:home/simple/Main: not found

main.cpp

 #include<iostream>

 int main(){
 std::cout<<"Hellow World";
 return 0;
 }

I compile this with : `g++ -o Main main.cpp`

Dockerfile

FROM ubuntu:latest
RUN mkdir -p /home/simple
COPY . /home/simple
CMD home/simple/Main

Docker commands
docker build -t myapp .
docker run myapp

P.S I have followed this guide :https://www.youtube.com/watch?v=kejsVBoP4kE

How can it not find the executable since it it is in the same folder with the Dockerfile.When i run COPY . /home/simple could it somehow happen to copy only 1/2 of the files?