Search code examples
yamldockerfilecicd

No Dockerfile matching /home/vscode/azure-pipelines/_work/1/s/**/Dockerfile was found


After installing the docker in the pipeline, it fixed the issue before. But now it says that there is no dockerfile matching.

I have try different path where the dockerfile is located at but the error has not been solved.

      
  - task: Docker@2
    displayName : Login to Docker Hub
    inputs:
        command: login
        containerRegistry: Docker_Hub #fypproject #dockerRegistryServiceConnection1 #

  - task: DockerInstaller@0
    displayName: Docker Installer
    inputs:
        dockerVersion: 17.09.0-ce
        releaseType: stable
    
  - task: Docker@2
    displayName: Build and Push
    inputs:
        command: buildAndPush
        repository:   max/newimage # username/contosoRepository for DockerHub
        #$dockerfile: /workspaces/FYP_Project/.devcontainer/Dockerfile
        dockerfile: /workspaces/FYP_Project/.devcontainer/Dockerfile
    #env:
       # PATH: /vscode/bin/linux-x64/695af097c7bd098fbf017ce3ac85e09bbc5dda06/bin/remote-cli:/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:/usr/local/dotnet/current:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/vscode/.dotnet/tools:/home/vscode/.local/bin
        #PATH: /workspaces/FYP_Project/.devcontainer/Dockerfile

picture of how the repo looks like


Solution

  • According to the documentation, It should be:

    Dockerfile: /workspaces/FYP_Project/.devcontainer/Dockerfile
    

    Notice the uppercase D.