Skip to content

Getting Error: NameResolutionFailure #482

@acastaner

Description

@acastaner

I'm trying to build a docker image for this MVC6 project. However when building it, the kpm restore command fails:

[root@localhost acastaner_mvc6]# docker build -t acastaner-fr .
Sending build context to Docker daemon 1.474 MB
Sending build context to Docker daemon 
Step 0 : FROM microsoft/aspnet
 ---> 98b0320569c3
Step 1 : COPY . /app
 ---> Using cache
 ---> 1d3e8bd0091b
Step 2 : WORKDIR /app
 ---> Using cache
 ---> 2ffc05cd0da3
Step 3 : RUN kpm restore
 ---> Running in a923b78da5fb
Restoring packages for /app/project.json
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.Framework.DependencyInjection'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Kestrel'.
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics
  Error: NameResolutionFailure
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
Warning: FindPackagesById: Microsoft.AspNet.Mvc
  Error: NameResolutionFailure
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc'.
Warning: FindPackagesById: Microsoft.AspNet.Server.WebListener
  Error: NameResolutionFailure
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics
  Error: NameResolutionFailure
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
Error: FindPackagesById: Microsoft.AspNet.Diagnostics
  Error: NameResolutionFailure

I'm running CentOS 7 and Docker 1.3 (the version available on the EPEL repository).

This is the Dockerfile (available on the Github repo):

FROM microsoft/aspnet

COPY . /app
WORKDIR /app
RUN ["kpm", "restore"]

EXPOSE 5004
ENTRYPOINT ["k", "kestrel"]

And this is the project.json:

{
    "webroot": "wwwroot",
    "version": "1.0.0-*",
    "dependencies": {
        "Microsoft.AspNet.Diagnostics": "1.0.0-beta3",
        "Microsoft.AspNet.Mvc": "6.0.0-beta3",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-beta3",
        "Microsoft.AspNet.StaticFiles": "1.0.0.0-beta3",
        "Microsoft.Framework.DependencyInjection": "1.0.0.0-beta3",
        "Kestrel": "1.0.0-*"
    },
    "frameworks": {
        "dnx451": { },
        "dnxcore50": { }
    },
    "bundleExclude": [
        "node_modules",
        "bower_components",
        "**.kproj",
        "**.user",
        "**.vspscc"
    ],
    "exclude": [
        "wwwroot",
        "node_modules",
        "bower_components"
    ],
    "commands": {
        "web ": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
        "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004"
    }
}

I'm not very clear if the "NameResolutionFailure" is a DNS problem, or an indication that the package wasn't found by name, or if it's a more generic issue. How can I help troubleshoot this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions