Run Paket without mono
See original GitHub issueDescription
Hi guys,
I’m trying to add Paket as my packages manager, the problem is that I’m using docker and aspnetcore-build image to build the project. Issue is when I call dotnet restore from within docker image. Apparently Paket is trying to use mono but aspnetcore-image only includes dotnet core SDK. Is there any way to handle this?
Repro steps
- Create Dockerfile, similar to:
FROM microsoft/aspnetcore-build AS builder
WORKDIR /source
COPY .paket/ .paket/
COPY paket.dependencies paket.dependencies
COPY src/restapi/restapi.csproj ./src/restapi/
RUN dotnet restore ./src/restapi/restapi.csproj
- Build docker image, like:
docker build -t myapp .
Expected behavior
image is created
Actual behavior
/usr/bin/sh: 2: /tmp/tmp9db3547cca0e4368ad3c85e5f64e7fbb.exec.cmd: mono: not found /source/.paket/Paket.Restore.targets(24,5): error MSB3073: The command “mono --runtime=v4.0.30319 “/source/.paket/paket.exe” restore --project “/source/src/restapi/restapi.csproj” --target-framework netcoreapp2.0” exited with code 127. [/source/src/restapi/restapi.csproj] The command ‘/bin/sh -c dotnet restore ./src/restapi/restapi.csproj’ returned a non-zero code: 1
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:10 (4 by maintainers)
Top GitHub Comments
@enricosada thanks for the note. Unfortunately I can only find two separate images for
netcore
andmono
(https://github.com/fsprojects/docker-fsharp/tree/master/4.1.29) but not one that has both. Am I missing something?Closing.
Work for .net core paket (and support in .net core sdk) is tracked by https://github.com/fsprojects/Paket/issues/2875
As a note, for dockerfile, you can use
fsharp/fsharp
image who contains both .net core and .net mono. With that, you can use docker multi staged builds, so you use an image with .netcore+mono to build, and more published result in another (with just .net core)