How to build .net core application in Jenkins using docker and push it to ECR?

Hi I am learning to build pipeline using Jenkins and AWS for my .net core application. I created sample application at https://github.com/niranjan2020/JenkinsPipeLine
I downloaded Jenkins in my local and running at port 8080. I created Pipeline template for creating Jenkins pipeline.

pipeline {
    agent any

    options {
        skipDefaultCheckout true
    }

    stages {
        stage('checkout') {
            steps {
                checkout scm
            }
        }

        stage('First Stage') {
            steps {
                echo "Yay! First stage is executed"
            }
        }
stage('Build') {
           agent {
              docker {
          image 'microsoft/dotnet:2.1-sdk'
          args '-u root:root'
        }
      }

      steps {
        sh 'apt update'
        sh 'apt install -y apt-transport-https'

        // sh 'echo "{\"buildNumber\":\"${BUILD_NUMBER}\", \"sha\":\"need to populate\"}" > Jenkins/buildinfo.json'
        sh 'echo Hi'
        sh 'chmod a+rw -R .'
        stash name: 'Jenkins-out', includes: 'Jenkins/out/**'
      }
    }
}
}

I want to build my .net core application using docker and put the image to ECR. Using above code I am able to execute first stage but I am not able to execute second stage.

process apparently never started in C:Program Files (x86)[email protected]@tmpdurable-8251f4a8
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)

This error message I am getting. In the above repository I have not added the docker file. Do I need to add it? Can someone help me to figure it out this? Any help would be appreciated. Thanks

Source: StackOverflow