s3rius / FastAPI-template

Feature rich robust FastAPI template.
MIT License
1.79k stars 161 forks source link

Unable to start project using docker on ubuntu machine #165

Closed 1995YogeshSharma closed 1 year ago

1995YogeshSharma commented 1 year ago

I am using ubuntu 22.04, poetry==1.4.2

On running the docker build command, I get following error -

 => ERROR [prod  2/10] RUN apt-get update && apt-get install -y   default-libmysqlclient-dev   gcc   && rm -rf /var/lib/apt/lists/*                                           23.4s
------
 > [prod  2/10] RUN apt-get update && apt-get install -y   default-libmysqlclient-dev   gcc   && rm -rf /var/lib/apt/lists/*:
#0 20.78 Err:1 http://deb.debian.org/debian buster InRelease
#0 20.78   Temporary failure resolving 'debian.map.fastlydns.net' Temporary failure resolving 'deb.debian.org'
#0 20.78 Err:2 http://security.debian.org/debian-security buster/updates InRelease
#0 20.78   Temporary failure resolving 'debian.map.fastlydns.net' Temporary failure resolving 'security.debian.org'
#0 23.03 Get:3 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
#0 23.28 Get:4 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]
#0 23.32 Fetched 65.4 kB in 23s (2889 B/s)
#0 23.32 Reading package lists...
#0 23.34 W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'debian.map.fastlydns.net' Temporary failure resolving 'deb.debian.org'
#0 23.34 W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'debian.map.fastlydns.net' Temporary failure resolving 'security.debian.org'
#0 23.34 W: Some index files failed to download. They have been ignored, or old ones used instead.
#0 23.35 Reading package lists...
#0 23.36 Building dependency tree...
#0 23.37 Reading state information...
#0 23.37 E: Unable to locate package default-libmysqlclient-dev
#0 23.37 E: Unable to locate package gcc
------
failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get install -y   default-libmysqlclient-dev   gcc   && rm -rf /var/lib/apt/lists/*]: exit code: 100

Any ideas on how to fix this?

s3rius commented 1 year ago

Hi and thanks for raising the issue. I need to take a look at this.I guess that most likely you have a problem with DNS, or we need to update the base image for the project.

1995YogeshSharma commented 1 year ago

@s3rius Thanks for quick response.

Network seems to work fine from my machine. I will try to create a docker image and check if there is connectivity issue form containers.

1995YogeshSharma commented 1 year ago

This was an issue with my docker setup. I had to update docker configuration and add "dns": ["8.8.8.8"] to it to make connection from inside containers work.

s3rius commented 1 year ago

Thank you for finding it out.