Docker Community Forums

Share and learn in the Docker community.

Not able to connect to Remote Sql Server from app hosted in container

I have created container for dot net core application.This application is connecting to sql server which is set up at some remote server .My container is running fine but i am not able to connect to sql server and getting following error :

Here is my docker file :
FROM AS build-env


Copy csproj and restore as distinct layers

#COPY *.csproj ./

#RUN dotnet restore

Copy everything else and build

COPY . ./

RUN dotnet publish appname -c Release -o out

Build runtime image



#COPY --from=build-env /app/out .

COPY --from=build-env /app/out .

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