title: Getting SSL error while trying to create docker image for AWS Lambda locally
body: <p>I am trying to create simple Hello World AWS Lambda function in .Net core 3.1 using Visual studio and trying to build docker image locally using command prompt.</p>
  <p>When I execute <strong>docker build -t Dockerfile .</strong> command, its giving following error:</p>
  <pre><code>------
   &gt; [build 4/7] RUN dotnet restore &quot;base/AWSDockerLambda.csproj&quot;:
  #12 1.555   Determining projects to restore...
  #12 3.592 /usr/share/dotnet/sdk/3.1.421/NuGet.targets(128,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/src/base/AWSDockerLambda.csproj]
  #12 3.592 /usr/share/dotnet/sdk/3.1.421/NuGet.targets(128,5): error :   The SSL connection could not be established, see inner exception. [/src/base/AWSDockerLambda.csproj]
  #12 3.592 /usr/share/dotnet/sdk/3.1.421/NuGet.targets(128,5): error :   The remote certificate is invalid according to the validation procedure. [/src/base/AWSDockerLambda.csproj]
  ------
  </code></pre>
  <p>Can anyone please help me here? Below is my Dockerfile:</p>
  <pre><code>FROM amazon/aws-lambda-dotnet:core3.1 AS base
  
  FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
  WORKDIR /src
  
  COPY [&quot;AWSDockerLambda.csproj&quot;, &quot;base/&quot;]
  RUN dotnet restore &quot;base/AWSDockerLambda.csproj&quot;
  
  WORKDIR &quot;/src&quot;
  COPY . .
  RUN dotnet build &quot;AWSDockerLambda.csproj&quot; --configuration Release --output /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;AWSLambdas3.csproj&quot; \
              --configuration Release \
              --framework netcoreapp3.1 \
              --self-contained false \  
              --output /app/publish
  
  FROM base AS final
  WORKDIR /var/task
  COPY --from=publish /app/publish .
  
  CMD [&quot;AWSDockerLambda::AWSDockerLambda.Function::FunctionHandler&quot;]
  </code></pre>