abhith / abhith.net

Personal website and blog running on Gatsby. Contains a collection of developer stories, videos, snippets, and tools grouped by topics.
https://www.abhith.net
MIT License
61 stars 24 forks source link

blog/docker-sql-error-on-aspnet-core-alpine/ #641

Closed utterances-bot closed 2 years ago

utterances-bot commented 4 years ago

Docker - SQL Error on ASP.NET Core Alpine | Abhith Rajan

Having trouble to connect to a remote SQL server from an ASP.NET Core app running on top of Alpine dotnet on a linux container?

https://www.abhith.net/blog/docker-sql-error-on-aspnet-core-alpine/

djvickx commented 4 years ago

Hi Abhith How do we add icu-libs package in docker image which is built using microsoft/dotnet:2.2-aspnetcore-runtime not alpine? As I am getting error apk not found when I try to add in my dockerfile using microsoft/dotnet:2.2-aspnetcore-runtime

abhith commented 4 years ago

@djvickx APK stands for Alpine Linux package manager, it will not be available with non-alpine images. The image "microsoft/dotnet:2.2-aspnetcore-runtime" is based on Debian (correct me if I'm wrong), and it uses apt-get CLI command to install packages. Another thing to note is the icu-libs is an Alpine Linux package so you might want to find a similar package under Debian.

If you are facing issues, the easiest solution would be switching the image.

djvickx commented 4 years ago

@Abhith Thanks for the clarification I got it now. I have also found out a way from official documentation about how to set Invariant Globalization setting in .net core project file, will try it out and if it doesn't work then I ll shift to alpine image.

tmacharia commented 4 years ago

This worked for me whilst usingmcr.microsoft.com/dotnet/core/sdk:3.1 with mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine