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

aspnet:6.0-alpine docker image problem #88

Closed
stefanodesimone opened this issue Sep 19, 2022 · 3 comments
Closed

aspnet:6.0-alpine docker image problem #88

stefanodesimone opened this issue Sep 19, 2022 · 3 comments

Comments

@stefanodesimone
Copy link

Hi all,
I'm using visual studio pro 2022, in my docker file i use:
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS base
Install:

  1. libgdiplus
  2. freetype-dev
  3. libpng-dev
  4. jpeg-dev
  5. libjpeg-turbo
  6. libjpeg-turbo-dev
  7. libc-dev
  8. libx11-dev

When i try to create a pdf file an error occur:
AggregateException: One or more errors occurred. (Unable to load native library. The platform may be missing native dependencies (libjpeg62, etc). Or the current platform is not supported.)

Can anyone help me?
Thx
Stefano

@HakanL
Copy link
Owner

HakanL commented Sep 19, 2022

The Alpine image is very bare-bones and requires quite a bit of dependencies. A good start is to look at what is in the sample https://github.com/HakanL/WkHtmlToPdf-DotNet/blob/master/src/TestConsoleAppDocker/Dockerfile. And also look at this issue that has a link to a potential solution. Once you figured out the solution feel free to post a PR with an Alpine docker example.

@HakanL
Copy link
Owner

HakanL commented Sep 19, 2022

I've added a sample now that uses Alpine, it's quite different from the other distribution (very skinny), so you may run into issues with images, etc (basically I only tested that it could generate the simple text-only PDF). I think it would be better to use the larger base distribution.
https://github.com/HakanL/WkHtmlToPdf-DotNet/tree/master/src/TestConsoleAppDockerAlpine

@HakanL HakanL closed this as completed Sep 19, 2022
@stefanodesimone
Copy link
Author

Work like a charm!!!
Thanks a lot
Stefano

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

2 participants