user3428422
user3428422

Reputation: 4560

GitHub Dockerfile not found at ./Dockerfile (.NET Core)

I know there is some information regarding this around the web, but I am new to this technology, and the information didn't seem to help my issue.

I am trying to trigger a docker build which is connected to my GitHub repository.

When I checked the solution into master from Visual Studio, I triggered the docker build and it failed with the below.

enter image description here

However, a potential issue could be that the Dockerfile is present in Github but not in the root folder. The file is found when I go into the solution folder which is how Visual Studio added the file.

This is where the Dockerfile is one level down.

enter image description here

And it's in here.

enter image description here

And I do have the Dockerfile present in the solution which I published as an Image to Docker Hub.

enter image description here

Anything obvious I have missed?

Thanks

Upvotes: 0

Views: 424

Answers (1)

norbjd
norbjd

Reputation: 11237

By default, DockerHub looks for a Dockerfile at the root of your project.

Because it is not the case here, you should specify the path to your Dockerfile in the Build rules section :

Specify the Dockerfile location as a path relative to the root of the source code repository. (If the Dockerfile is at the repository root, leave this path set to /.)

This screenshot shows some configuration (there are multiple build rules here, but focus on the column Dockerfile location) :

Build rules

In your example, you should set Dockerfile location to MyFirstContainerApp/Dockerfile.

Upvotes: 1

Related Questions