dotnet / dotnet-docker-nightly

This repository has moved to the nightly branch of dotnet/dotnet-docker.

Home Page:https://github.com/dotnet/dotnet-docker/tree/nightly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Current Nightly Docker image unable to run any dotnetcore apps

pms1969 opened this issue · comments

Steps to reproduce the issue

~/s/f/core-dotnetcore   dotnetcore *$…  docker run --rm -ti -v (pwd):/root/ -v /home/paul/.aws:/root/.aws -p 8282:8282 microsoft/dotnet-nightly:2.0-sdk bash
root@3a23c05bbe43:/# mkdir /tmp/paul
root@3a23c05bbe43:/# cd /tmp/paul
root@3a23c05bbe43:/tmp/paul# dotnet new console
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /tmp/paul/paul.csproj...
Restore succeeded.

root@3a23c05bbe43:/tmp/paul# dotnet restore
  Restoring packages for /tmp/paul/paul.csproj...
/usr/share/dotnet/sdk/2.0.0-preview2-006215/NuGet.targets(98,5): warning : Dependency specified was Microsoft.NETCore.App (>= 2.0.0-preview2-25324-03) but ended up with Microsoft.NETCore.App 2.0.0-preview2-25401-01. [/tmp/paul/paul.csproj]
  Lock file has not changed. Skipping lock file write. Path: /tmp/paul/obj/project.assets.json
  Restore completed in 172.73 ms for /tmp/paul/paul.csproj.
  
  NuGet Config files used:
      /root/.nuget/NuGet/NuGet.Config
  
  Feeds used:
      https://api.nuget.org/v3/index.json
      /root/.dotnet/NuGetFallbackFolder
root@3a23c05bbe43:/tmp/paul# dotnet build
Microsoft (R) Build Engine version 15.3.246.41955 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  paul -> /tmp/paul/bin/Debug/netcoreapp2.0/paul.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:02.21
root@3a23c05bbe43:/tmp/paul# dotnet publish 
Microsoft (R) Build Engine version 15.3.246.41955 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  paul -> /tmp/paul/bin/Debug/netcoreapp2.0/paul.dll
  paul -> /tmp/paul/bin/Debug/netcoreapp2.0/publish/
root@3a23c05bbe43:/tmp/paul# dotnet bin/Debug/netcoreapp2.0/publish/paul.dll
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.0.0-preview2-25401-01' was not found.
  - Check application dependencies and target a framework version installed at:
      /
  - Alternatively, install the framework version '2.0.0-preview2-25401-01'.
root@3a23c05bbe43:/tmp/paul# 

Expected behavior

At the very least, I'd expect that to print "Hello World!"

Actual behavior

That error

Additional information (e.g. issue happens only occasionally)

Happens consistently. I was actually trying to get a compile version of an app that uses the SignalR packages from the aspnet-dev myget repo, and stumbled around that error for hours before I decided it must be more insidious than my narrow knowledge of .netcore2.0

I doubt this is a docker issue, it's something peculiar to the nightly image. I even tried creating a new image with the latest preview that I could discover (006236), but that has the same issue.

Output of docker version

$ docker version
Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.8.1
 Git commit:   89658bed64
 Built:        Fri May  5 22:40:58 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.8.1
 Git commit:   89658bed64
 Built:        Fri May  5 22:40:58 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info

docker info        
Containers: 7
 Running: 0
 Paused: 0
 Stopped: 7
Images: 191
Server Version: 17.05.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.11.3-2-zen
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.6GiB
Name: chulak
ID: Q5R4:VMTX:45AB:E37M:QBFM:3IDF:Z6AL:DDKK:3CGT:RYIM:KI3P:34LS
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: pms1969
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

The nightly repo contains the latest builds of .NET Core. A consequence of this is sometimes workarounds are needed. Because of some issues in CLI right now, you will need to specify a custom NuGet feed to get the correct packages loaded. When restoring try this instead - dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json -s https://api.nuget.org/v3/index.json

Thank you Michael. That worked. As it turns out, I'd eventually figured that I could apt-get it as well, but I much prefer your solution... Cheers.