I’m building Docker images using the Fedora base image occasionally and am facing massiv issues with it being slow. Also to be honest creating the cache is slow in general with all my devices. It also seems to request all resources sequentially instead of in parallel.
There is more than enough bandwidth available, but the latency is varying (1000/50 koaxial cable connection). Location wise I live close to one of the largest internet exchanges in the world.
Building without already build cache
Executed in 161,70 secs fish external
usr time 86,13 millis 652,00 micros 85,48 millis
sys time 72,28 millis 163,00 micros 72,11 millis
Building with an already build cache (I introduced a layer for the cache which is already cached):
Executed in 39,12 secs fish external
usr time 132,37 millis 0,00 micros 132,37 millis
sys time 83,41 millis 989,00 micros 82,42 millis
Is there anything which can be done? Is parallelization already in work?
You also have to take in consideration that you might playing with to different cache’s. On the workstation it self at least. I don’t know how it looks like with docker … do you always use sudo to use dnf?
I had the problem that when i just wanted to get an info of a package that i used dnf without sudo. This creates a cache for my own user … if you do with sudo it creates a other cache for the root privileged user. I always was creating cache while waiting to execute the command it self.
Yep, so to ensure that you only have one cache and update it only once for each transaction you should always run dnf either as root or with sudo. That avoids the extra cache actions and time requirements for the individual user.
I just did a dnf list as my regular user and it took about 2.5 minutes to build the cache. That was with the fastest mirror option in dnf.conf. As root it took ~1 second.
Thank you, both. But it doesn’t bring this forward. The Fedora Docker image has no cache (and shouldn’t have one, as it would blow up the image). The issue is that the creation is taking too long and one issue with that is that dnf does not seem to download all data in parallel but one by one. And especially the cisco repo has very high latency.