docker镜像运行后,无法进行连接到数据库,主机名字或服务没有听过

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
运行结果及报错内容

Database connection failure: could not translate host name "db" to address: Name or service not known

我的解答思路和尝试过的方法

修改 容器的配置文件,使能够正常连接

我想要达到的结果