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

Using aspnetcore:1.1.7 image seems to include 1.1.6 #396

Closed JamieKeeling closed 6 years ago

JamieKeeling commented 6 years ago

I am trying to update a Dockefile that makes use of the new build / runtime images as part of the recently announced MSA (SDK 1.1.8, Runtime 1.1.7) however I am seeing seemingly invalid results.

Steps to reproduce the issue

  1. Using the 1.1.8 SDK, create a new ASP.NET Web API core app targeting the netcoreapp1.1 framework

dotnet new webapi --framework netcoreapp1.1

  1. Open the .CSPROJ for the created project and add the RuntimeTargetFramework flag to the PropertyGroup section, specifying that 1.1.7 should be used

<RuntimeFrameworkVersion>1.1.7</RuntimeFrameworkVersion>

  1. Create a Dockerfile with the following content
FROM microsoft/aspnetcore-build:1.1.7-1.1.8 as build

ENV APP_HOME /dotnetapp
ENV SERVICE_PATH $APP_HOME/Test.csproj

COPY . $APP_HOME/
WORKDIR $APP_HOME

RUN dotnet restore $APP_HOME

RUN dotnet build $SERVICE_PATH && dotnet publish $SERVICE_PATH \
    -c release \
    -o /output

FROM microsoft/aspnetcore:1.1.7 as runtime

#ENV are per stage, not per file, so reset APP_HOME
ENV APP_HOME /dotnetapp

#Copy output from build stage
COPY --from=build /output $APP_HOME

WORKDIR $APP_HOME
EXPOSE 8080
ENV ASPNETCORE_URLS "http://0.0.0.0:8080/"
ENTRYPOINT ["dotnet", "Test.dll"]
  1. Build the Dockerfile

docker build -t sampleapp .

  1. Run image

docker run -t sampleapp

Expected behavior

Application executes against the 1.1.7 runtime, and listens for incoming connections on localhost:5000

Actual behavior

Application outputs the following:

The specified framework 'Microsoft.NETCore.App', version '1.1.7' was not found.

  • Check application dependencies and target a framework version installed at: /usr/share/dotnet/shared/Microsoft.NETCore.App
  • The following versions are installed: 1.1.6
  • Alternatively, install the framework version '1.1.7'.

Additional information

The previous release of the associated Docker images worked correctly (our previous usage)

SDK: microsoft/aspnetcore-build:1.1.6-1.1.7 Runtime: microsoft/aspnetcore:1.1.6

Output of dotnet --info

.NET Command Line Tools (1.1.8)

Product Information:
 Version:            1.1.8
 Commit SHA-1 hash:  227be613d2

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

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.6
  Build    : 74b1c703813c8910df5b96f304b0f2b78cdf194d

Output of docker info

Containers: 6
 Running: 0
 Paused: 0
 Stopped: 6
Images: 31
Server Version: 17.12.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 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: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.60-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: 6GM3:MY2U:UR26:UNEK:AY5Q:HS4S:MEML:YMMA:6NR2:YQG5:X67B:SZZX
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 22
 Goroutines: 41
 System Time: 2018-03-23T21:27:43.629757027Z
 EventsListeners: 2
HTTP Proxy: docker.for.mac.http.internal:3128
HTTPS Proxy: docker.for.mac.http.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
MichaelSimons commented 6 years ago

@natemcmaster - looks like 1.1 runtime Dockerfiles aren't referencing the latest microsoft/dotnet 1.1 runtime images.

natemcmaster commented 6 years ago

Thanks for catching this @JamieKeeling. The images should be rebuilt over the next hour or so as our CD updates Docker Hub.