I have someone set up docker in my machine and everything has been working smoothly until now. I just tried to pruned the volumes to free up some space. When i try to rebuild the iamge (forgive me if i am not using the correct terms here, as I am quite new to this and focus on data analysis part), i ran into the below errors.
=> [internal] load build definition from Dockerfile.python 0.0s
=> => transferring dockerfile: 1.70kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/centos:latest 1.9s
=> CACHED [ 1/16] FROM docker.io/library/centos:latest@sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55b 0.0s
=> CANCELED [internal] load build context 1.1s
=> => transferring context: 49.99MB 1.0s
=> ERROR [ 2/16] RUN dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos -y && 1.1s
------
> [ 2/16] RUN dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos -y && dnf distro-sync -y:
0.962 CentOS Linux 8 - Extras 0.0 B/s | 0 B 00:00
0.962 Errors during downloading metadata for repository 'extras':
0.962 - Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=extras&infra=container [Could not resolve host: mirrorlist.centos.org]
0.969 Error: Failed to download metadata for repo 'extras': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=extras&infra=container [Could not resolve host: mirrorlist.centos.org]
------
Dockerfile.python:3
--------------------
2 |
3 | >>> RUN dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos -y &&
4 | >>> dnf distro-sync -y
5 |
--------------------
ERROR: failed to solve: process "/bin/sh -c dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos -y && dnf distro-sync -y" did not complete successfully: exit code: 1
I believe it is the line below in my docker file that is causing the error. How can I mitigate this ?
RUN dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos -y &&
dnf distro-sync -y