Skip to main content
1 of 3

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?