Paket: Run Paket without mono

Created on 25 Aug 2017  Â·  10Comments  Â·  Source: fsprojects/Paket

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

Most helpful comment

@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?

All 10 comments

ohhh I see now where is the problem. Is it possible to run paket on Linux using dotnet core instead of mono? I assume that not currently because it's not compiled targeting core. :(

We plan to do this in the future. But we need help here. We're not even
sure how bootstrapping and stuff like that will work.

Am 25.08.2017 10:00 schrieb "whitebear-gh" notifications@github.com:

ohhh I see now where is the problem. Is it possible to run paket on Linux
using dotnet core instead of mono? I assume that not currently because it's
not compiled targeting core. :(

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/fsprojects/Paket/issues/2660#issuecomment-324850776,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNB0Bax_GbhGQBu9HA0M8pfBI0JPAks5sbn8IgaJpZM4PCVRF
.

Just chiming in that this is the thing keeping me from using Paket. Would definitely like to be able to run Paket on OSX without mono.

How would ypu expect it to work? Ie what jt the workflow to get bootstrapped (in netcore we don't have standalone exes anymore)

I'm not sure I understand the problem. You can still publish a standalone app in dotnetcore (unless I'm misinformed)

How?

Am 08.09.2017 08:41 schrieb "Craige Leeder" notifications@github.com:

I'm not sure I understand the problem. You can still publish a standalone
app in dotnetcore (unless I'm misinformed)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/fsprojects/Paket/issues/2660#issuecomment-328013869,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNKgCgqXRL5SAKJl9BIDNvHZ0LTR-ks5sgOGWgaJpZM4PCVRF
.

you can do a "standalone" publish, but this will result in a big folder, not a single-file executable.

And it is obviously platform dependent, you need different versions for windows / linux / osx.

dotnet publish -c release -r osx.10.10-x64 for example.


To get started, you would probably need a native script (.ps1 / .sh), which downloads and unzips the required version.

@forki, @0x53a - See this thread (nearer the end for dotnetcore2): https://github.com/dotnet/core/issues/77, and this documentation: https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli

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)

@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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alfonsogarciacaro picture alfonsogarciacaro  Â·  8Comments

ModernRonin picture ModernRonin  Â·  7Comments

JohnyWS picture JohnyWS  Â·  7Comments

haf picture haf  Â·  7Comments

pshrosbree picture pshrosbree  Â·  3Comments