Running dotNet 4.0 application in docker image

I want to run a dotnet application in docker image. I am using official dotNet build microsoft/dotnet:1.0-core-deps from docker hub. My docker file looks like below

FROM microsoft/dotnet:1.0-core-deps

RUN apt-get update
&& apt-get install -y --no-install-recommends
ca-certificates
curl
&& rm -rf /var/lib/apt/lists/*

Install .NET Core

ENV DOTNET_VERSION 1.0.1
ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_VERSION/dotnet-debian-x64.$DOTNET_VERSION.tar.gz

RUN curl -SL $DOTNET_DOWNLOAD_URL --output dotnet.tar.gz
&& mkdir -p /usr/share/dotnet
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet
&& rm dotnet.tar.gz
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet

COPY /DotNetApp /home/DotNetApp
WORKDIR /home/DotNetApp/
CMD example.exe

Then I build image and after that while running the image getting “/bin/sh: 1: cod.exe: not found” error. This project uses a huge dll files for report and grid generation.

As far as I know .NET 4.0 applications will never run on .NET Core 1.0. I see 2 options.

  1. Migrate your application to .NET Core 1.0

  2. Use Mono http://www.mono-project.com/ https://github.com/mono/docker