New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
FelschR opened this Issue Sep 14, 2017 · 9 comments

Comments

Projects
None yet
3 participants
@FelschR

FelschR commented Sep 14, 2017

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

This comment has been minimized.

Member

natemcmaster commented Sep 14, 2017

Microsoft.Docker.Sdk isn't included in the .NET Core SDK. It's only available from Visual Studio. See dotnet/cli#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

This comment has been minimized.

FelschR commented Sep 15, 2017

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

@natemcmaster

This comment has been minimized.

Member

natemcmaster commented Sep 15, 2017

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

@FelschR

This comment has been minimized.

FelschR commented Sep 15, 2017

@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

This comment has been minimized.

Member

natemcmaster commented Sep 15, 2017

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

This comment has been minimized.

FelschR commented Sep 15, 2017

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

@natemcmaster

This comment has been minimized.

Member

natemcmaster commented Sep 15, 2017

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

This comment has been minimized.

weklund commented Mar 21, 2018

@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

This comment has been minimized.

Member

natemcmaster commented Mar 21, 2018

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 aspnet/Announcements#292

xiangyan99 added a commit to xiangyan99/WeiXinMPSDK that referenced this issue May 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment