dotnet / dotnet-docker-nightly

This repository has moved to the nightly branch of dotnet/dotnet-docker.
https://github.com/dotnet/dotnet-docker/tree/nightly
MIT License
35 stars 30 forks source link

dotnet runtime errors in docker container on Ubuntu 16.04.3 #489

Closed ahazelwood closed 6 years ago

ahazelwood commented 6 years ago

Steps to reproduce the issue

  1. Login to a vanilla Ubuntu 16.04.3 LTS instance.

    Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-98-generic x86_64)
  2. Ensure latest docker-ce version is installed.

    root@ship02:/home/ahazelwood# docker --version
    Docker version 17.09.0-ce, build afdb6d4
  3. Create a local Dockerfile

    root@ship02:/home/ahazelwood# cat Dockerfile
    FROM microsoft/dotnet:2.0-runtime
    WORKDIR /app
    ENTRYPOINT ["/bin/bash"]
  4. Run: docker build . -t testah

    root@ship02:/home/ahazelwood# docker build . -t testah
    Sending build context to Docker daemon  14.34kB
    Step 1/3 : FROM microsoft/dotnet:2.0-runtime
    ---> c73382e1bbf7
    Step 2/3 : WORKDIR /app
    ---> e7c12683c292
    Removing intermediate container 5f02eb55c496
    Step 3/3 : ENTRYPOINT /bin/bash
    ---> Running in 31dddb3f96ba
    ---> 61b80806a390
    Removing intermediate container 31dddb3f96ba
    Successfully built 61b80806a390
    Successfully tagged testah:latest
  5. Run the container and issue the command dotnet --version

    root@ship02:/home/ahazelwood# docker run -it testah
    root@bd50671c6ca1:/app# dotnet --version
    Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
    http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

Expected behavior

I would expect the latest version to get printed from the console.

Actual behavior

Error message as stated in point 5 above.

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

I was attempting to create a custom dotnet core console app from my windows machine within a linux container. However, whenever I attempt to run my container with the following docker container, I get the output below.

FROM microsoft/dotnet:2.0-runtime
WORKDIR /app
COPY ./bin /app
ENTRYPOINT ["dotnet", "CI.Processing.ProcessTest.dll"]
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
  - Check application dependencies and target a framework version installed at:
      /
  - Alternatively, install the framework version '2.0.0'.

Output of docker version

root@ship02:/home/ahazelwood# docker version
Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:42:18 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:56 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info

root@ship02:/home/ahazelwood# docker info
Containers: 10
 Running: 8
 Paused: 0
 Stopped: 2
Images: 12
Server Version: 17.09.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
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-98-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 6
Total Memory: 9.732GiB
Name: ship02
ID: XYF3:R35G:JFAH:YC22:OH46:4SQX:6XR3:VJYK:T44D:LKR5:VWZK:7PUE
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
ahazelwood commented 6 years ago

It turns out that I had an issue with an earlier version of the dotnet-2.0 runtime hanging around in docker and docker was not pulling the latest. Once I force a re-pull of the runtime, things worked as expected. I also noticed that I have to do a dotnet --info instead of --version now.