question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Paket without mono

See original GitHub issue

Description

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

  1. 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
  1. 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:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
drinkbirdcommented, Jan 24, 2018

@enricosada thanks for the note. Unfortunately I can only find two separate images for netcore and mono (https://github.com/fsprojects/docker-fsharp/tree/master/4.1.29) but not one that has both. Am I missing something?

1reaction
enricosadacommented, Jan 23, 2018

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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Paket installation
How to install Paket for Windows, Linux, or macOS. ... linux/osx: Run mono .paket/paket.bootstrapper.exe; Commit .paket/paket.bootstrapper.exe into your ...
Read more >
The paket.dependencies file
A dependency manager for .NET with support for NuGet packages and git repositories.
Read more >
New to F# and really confused with the tooling (dotnet ...
If I run fsharpi I get the Mono version which is not the same version that is used by dotnet build . Upvote...
Read more >
Using Paket With MyGet Feeds
Just like NuGet, Paket is a dependency manager for .NET and Mono projects. It is designed to work with NuGet packages but also...
Read more >
Paket 7.2.1
Run build.cmd ( build.sh on Mono) to make sure all tests are still passing. When built, you'll find the binaries ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found