Dockerized Wisej app / ,net8.0

0
0

I am trying to dockrize wisej app (framework 3.5.17).
here is Dockerfile:

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
RUN apt-get update && apt-get install -y apt-utils
RUN apt-get install -y libfontconfig1
RUN apt-get install -y libgdiplus
#Install ms fonts.
# for dotnet 6
# RUN sed -i’.bak’ ‘s/$/ contrib/’ /etc/apt/sources.list
# RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig
# for dotnet 8
RUN echo “deb http://deb.debian.org/debian bookworm contrib non-free” > /etc/apt/sources.list.d/contrib.list
RUN apt update && apt upgrade
RUN apt install ttf-mscorefonts-installer -y

#This needs to be folder where app is published as Linux-64 Release with .net 8.0

COPY x/ app/
WORKDIR /app
EXPOSE 8080
#EXPOSE 443

ENTRYPOINT [“dotnet”, “wisejapp.dll”]

But I am encountering error that should be resolved with libgdiplus library (verified it is installed), and strange ServerLicense error (despite license not being assigned anywhere else)

An help would be appreciated.

  • You must to post comments
0
0

Hi Dino,

You don’t need to install libgdiplus if you’re using aspnet:8.0 as your base image:

Please use this docker file instead:

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

#Install standard fonts
RUN echo “deb http://deb.debian.org/debian/ bookworm main contrib” > /etc/apt/sources.list && \
echo “deb-src http://deb.debian.org/debian/ bookworm main contrib” >> /etc/apt/sources.list && \
echo “deb http://security.debian.org/ bookworm-security main contrib” >> /etc/apt/sources.list && \
echo “deb-src http://security.debian.org/ bookworm-security main contrib” >> /etc/apt/sources.list
RUN sed -i’.bak’ ‘s/$/ contrib/’ /etc/apt/sources.list
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig

WORKDIR /app
EXPOSE 80
EXPOSE 443

ENTRYPOINT [“dotnet”, “WisejWebApplication17.dll”]

Best,
Alaa

  • Dino Novak
    this is hitting error “E: Package ‘ttf-mscorefonts-installer’ has no installation candidate”
  • Alaa (ITG)
    I can’t reproduce the error, try to copy the Dockerfile from a new project template, all you need to do is to change the name of the DLL from there.
  • Dino Novak
    OK, docker compose creates a container image BUT, EXPOSE 80 in not exposing app, port that app is exposed is 8080, and same error pops out “An unexpected error occurred GH: The type initializer for ‘Wisej. Web.Control’ threw an exception. at Wisej. Web. Control.get_DefaultMargin() at Wisej. Web. Control..ctor() at Wisej.Web.ScrollableControl..ctor() at Wisej.Web. ContainerControl..ctor() at Wisej. Web.Form..ctor() at maritag_Portal.winLogin..ctor() in …”
  • Dino Novak
    Just found that from .net8.0 MS changed default port for exposing to 8080 https://learn.microsoft.com/en-us/dotnet/core/compatibility/containers/8.0/aspnet-port
  • You must to post comments
0
0

Just for reference on installed versions:

root@4920570cb1a4:/app# apt-get install libgdiplus
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
libgdiplus is already the newest version (6.1+dfsg-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@4920570cb1a4:/app# apt-get install libfontconfig1
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
libfontconfig1 is already the newest version (2.14.1-4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@4920570cb1a4:/app# apt-get install fontconfig
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
fontconfig is already the newest version (2.14.1-4).
fontconfig set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@4920570cb1a4:/app# apt-get install ttf-mscorefonts-installer
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
ttf-mscorefonts-installer is already the newest version (3.8.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.