The problem for me was that I had a ".git" folder inside my context folder. Which couldn't be copied to the container on the build.
So what I had to do was create a .dockerignore file in the context folder and add the '.git' folder to it.