aspnet / aspnet-docker

[Archived] ASP.NET Core Docker images for 1.x. Go to https://github.com/dotnet/dotnet-docker for 2.1 and up.
https://asp.net
719 stars 171 forks source link

Docker CI build fails due to missing 'Microsoft.Docker.Sdk' #299

Closed felschr closed 7 years ago

felschr commented 7 years ago

Steps to reproduce the issue

(e.g. copy your Dockerfile or docker-compose.yml file here)

  1. Create a ASP.NET Core 2.0 project with docker support in Visual Studio
  2. Adjust docker-compose.ci.build.yml to use image microsoft/aspnetcore-build:2.0 if not already set
  3. Run docker-compose -f .\docker-compose.ci.build.yml up

Expected behavior

Build succeeds

Actual behavior

Build fails with: /src/docker-compose.dcproj : error MSB4236: The SDK 'Microsoft.Docker.Sdk' specified could not be found.

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

Happened to me after upgrading from ASP.NET Core 1.0 to 2.0. I first noticed this issue when my build on VSTS failed. Building from within Visual Studio 2017 works.

Output of dotnet --info

.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

Output of docker info

Containers: 118
 Running: 3
 Paused: 0
 Stopped: 115
Images: 36
Server Version: 17.06.2-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 ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 6e23458c129b551d5c9871e5174f6b1b7f6d1170
runc version: 810190ceaa507aa2727d7ae6f4790c76ec150bd2
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.41-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: moby
ID: 3RWV:FUSO:3XU6:PALB:IG2T:KPCE:SEVD:WEXE:IOIM:3XQA:YTX7:YJ2U
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 44
 Goroutines: 51
 System Time: 2017-09-14T09:16:51.7507385Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
natemcmaster commented 7 years ago

Microsoft.Docker.Sdk isn't included in the .NET Core SDK. It's only available from Visual Studio. See https://github.com/dotnet/cli/issues/6178.

Adjust docker-compose.ci.build.yml to use image microsoft/aspnetcore-build:2.0

What was the original image VS gave you? Changes are good they picked a different image, one that is designed to work with VS tooling.

felschr commented 7 years ago

@natemcmaster I was using microsoft/aspnetcore-build:1.0-1.1 before without issues.

natemcmaster commented 7 years ago

Try this one: microsoft/aspnetcore-build:1.0-2.0. We had to custom make these "CI build" images to work with VS.

felschr commented 7 years ago

@natemcmaster oh, awesome! I'll try it as soon as possible. I didn't notice those builds. Is it documented somewhere where the differences between these images are?

natemcmaster commented 7 years ago

Is it documented somewhere where the differences between these images are?

None that I'm aware of. :-( VS + Docker tooling has some rough edges, and this is one of them.

felschr commented 7 years ago

Aaaaand it's working!! Thanks a lot, @natemcmaster !

natemcmaster commented 7 years ago

Happy to help. Glad its working for you.

For anyone else hitting this issue, the solution is to use microsoft/aspnetcore-build:1.0-2.0.

Close in favor of dotnet/cli#6178.

weklund commented 6 years ago

@natemcmaster Is this image tightly coupled with VS? Still having the same issue when using microsoft/aspnetcore-build:1.0-2.0

$ dotnet --info
.NET Command Line Tools (2.1.101)

Product Information:
 Version:            2.1.101
 Commit SHA-1 hash:  6c22303bf0

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.101/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.6
  Build    : 74b1c703813c8910df5b96f304b0f2b78cdf194d
natemcmaster commented 6 years ago

Just tried, and I couldn't repro MSB4236 with microsoft/aspnetcore-build:1.0-2.0. If you're having trouble, please open a new issue with repro steps.

Heads up - we are deprecating microsoft/aspnetcore-build:1.0-2.0. See https://github.com/aspnet/Announcements/issues/292