Hi,
hope i can receieve some solution for the following issue: dependent services can not access each other, we receieve DNS resolution error.
We have the following configuration:
app - is a .Net Core web application
db - PostgreSQL database
gitlab-ci.yml job:
newman_test:
variables:
ASPNETCORE_ENVIRONMENT: Stage
stage: test
image:
name : private_repo:5050/base-image/os/centos:7tags:
- DokerRun1
services:
- name: private_repo:5050/calin/aspnet-docker-compose/db
alias: db
- name: private_repo:5050/calin/aspnet-docker-compose/app
alias: appscript:
- curl http://app:5000/home/dbinfo
During execution the app can not access the database, we receive the following error:
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000005, 0xFFFDFFFF): Name or service not known
at System.Net.Dns.InternalGetHostByName(String hostName)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.ConnectorPool.AllocateLong(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<g__OpenLong|0>d.MoveNext()
— End of stack trace from previous location where exception was thrown —
ConnectionString in the application is defined correctly it includes the db as Host:
“ConnectionStrings”: {
“DefaultConnection”: “Host=db;Database=sac;Username=sac_user;Password=sac_docker”
}
The same configuration started localy using docker-compose works as expected…
Thank you.