Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Paket without mono #2660

Closed
whitebear-gh opened this issue Aug 25, 2017 · 10 comments
Closed

Run Paket without mono #2660

whitebear-gh opened this issue Aug 25, 2017 · 10 comments

Comments

@whitebear-gh
Copy link

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

@whitebear-gh
Copy link
Author

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. :(

@forki
Copy link
Member

forki commented Aug 25, 2017 via email

@Craige
Copy link

Craige commented Sep 8, 2017

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.

@matthid
Copy link
Member

matthid commented Sep 8, 2017

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

@Craige
Copy link

Craige commented Sep 8, 2017

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

@forki
Copy link
Member

forki commented Sep 8, 2017 via email

@0x53A
Copy link
Contributor

0x53A commented Sep 8, 2017

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.

@Craige
Copy link

Craige commented Sep 8, 2017

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

@enricosada
Copy link
Collaborator

Closing.

Work for .net core paket (and support in .net core sdk) is tracked by #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)

@drinkbird
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants