# Could not resolve host: mirrors.centos.org during the build of the docker container image

**URL:** <https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [June 2, 2023, 2:17pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050 "2023-06-02T14:17:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [June 2, 2023, 2:17pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/1 "2023-06-02T14:17:09Z")

</div>

I’m trying to build our own docker container image with:

su - awx  
git clone -b 22.3.0 [https://github.com/ansible/awx.git](https://github.com/ansible/awx.git)  
cd awx  
git switch -c release\_4.4  
. /opt/awx/venv/bin/activate  
make docker-compose-build

which leads to:

ansible-playbook tools/ansible/dockerfile.yml   
-e dockerfile\_name=Dockerfile.dev   
-e build\_dev=True   
-e receptor\_image=[quay.io/ansible/receptor:devel](http://quay.io/ansible/receptor:devel)  
[WARNING]: No inventory was parsed, only implicit localhost is available  
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’

PLAY [Render AWX Dockerfile and sources] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [dockerfile : Create \_build directory] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [dockerfile : Render supervisor configs] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> (item=supervisor\_web.conf)  
ok: [localhost] =\> (item=supervisor\_task.conf)  
ok: [localhost] =\> (item=supervisor\_rsyslog.conf)

TASK [dockerfile : Render Dockerfile] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=4 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

DOCKER\_BUILDKIT=1 docker build   
-f Dockerfile.dev   
-t [ghcr.io/ansible/awx\_devel:release\_4.4](http://ghcr.io/ansible/awx_devel:release_4.4)   
–build-arg BUILDKIT\_INLINE\_CACHE=1   
–cache-from=[ghcr.io/ansible/awx\_devel:release\_4.4](http://ghcr.io/ansible/awx_devel:release_4.4) .  
[+] Building 75.7s (11/47)  
=\> [internal] load build definition from Dockerfile.dev 0.0s  
=\> =\> transferring dockerfile: 7.57kB 0.0s  
=\> [internal] load .dockerignore 0.0s  
=\> =\> transferring context: 56B 0.0s  
=\> [internal] load metadata for [quay.io/ansible/receptor:devel](http://quay.io/ansible/receptor:devel) 0.4s  
=\> [internal] load metadata for [quay.io/centos/centos:stream9](http://quay.io/centos/centos:stream9) 0.4s  
=\> importing cache manifest from [ghcr.io/ansible/awx\_devel:release\_4.4](http://ghcr.io/ansible/awx_devel:release_4.4) 0.8s  
=\> [builder 1/10] FROM [quay.io/centos/centos:stream9@sha256:d075b8cb028de107de53d601512f6f2fc70c8d3c1313959d5925a5386dd1d665](http://quay.io/centos/centos:stream9@sha256:d075b8cb028de107de53d601512f6f2fc70c8d3c1313959d5925a5386dd1d665) 0.0s  
=\> [internal] load build context 0.0s  
=\> =\> transferring context: 47.03kB 0.0s  
=\> FROM [quay.io/ansible/receptor:devel@sha256:b14b7bc6a77fa04e61fd550bdec0e4134aedba23a4144bcd13ce738523c6acf9](http://quay.io/ansible/receptor:devel@sha256:b14b7bc6a77fa04e61fd550bdec0e4134aedba23a4144bcd13ce738523c6acf9) 0.0s  
=\> CACHED [builder 2/10] RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial 0.0s  
=\> ERROR [builder 3/10] RUN dnf -y update && dnf install -y ‘dnf-command(config-manager)’ && dnf config-manager --set-enabled crb && dnf -y install gcc 74.4s  
=\> ERROR [stage-1 3/32] RUN dnf -y update && dnf install -y ‘dnf-command(config-manager)’ && dnf config-manager --set-enabled crb && dnf -y install acl 74.3s

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [June 2, 2023, 2:41pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/2 "2023-06-02T14:41:33Z")

</div>

Same issue with:

- awx\_devel:release\_4.2
- awx\_devel:release\_4.3

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [June 2, 2023, 4:00pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/3 "2023-06-02T16:00:35Z")

</div>

I have no such issue using a CentOS stream 9 host instead of Ubuntu.

Any idea why?

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [June 2, 2023, 6:23pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/4 "2023-06-02T18:23:01Z")

</div>

We see this error and seems relevant to your issue  
#0 74.30 - Curl error (6): Couldn’t resolve host name for [https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86\_64&protocol=https,http](https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http) [Could not resolve host: [mirrors.centos.org](http://mirrors.centos.org)]

are you able to successfully curl this url from the terminal that you are running the make docker-compose-build [https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86\_64&protocol=https,http](https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http)

AWX Team

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [June 5, 2023, 12:19pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/5 "2023-06-05T12:19:08Z")

</div>

Yes:

(venv) awx@sdx1-kvm:~/git-awx$ curl [https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86\_64&protocol=https,http](https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http)  
[1] 137878  
[2] 137879  
(venv) awx@sdx1-kvm:~/git-awx$ \<?xml version="1.0" encoding="utf-8"?\>

[1]- Done curl [https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream](https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream)  
[2]+ Done arch=x86\_64  
(venv) awx@sdx1-kvm:~/git-awx$

The issue is still there when ‘make docker-compose-build’ is run as awx (non-root) user.  
Here is some issue(s) which appear in the docker log:

# echo ‘q’ | sudo systemctl --no-pager --full status docker

● docker.service - Docker Application Container Engine  
Loaded: loaded (/lib/systemd/system/docker.service; enabled; preset: enabled)  
Active: active (running) since Mon 2023-06-05 11:42:24 UTC; 14min ago  
TriggeredBy: ● docker.socket  
Docs: [https://docs.docker.com](https://docs.docker.com)  
Main PID: 59654 (dockerd)  
Tasks: 12  
Memory: 216.0M  
CPU: 3.006s  
CGroup: /system.slice/docker.service  
└─59654 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Jun 05 11:50:58 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:50:58.721767833Z” level=debug msg=“2023/06/05 11:50:58 WARNING: [core] [Channel #11 SubChannel #12] grpc: addrConn.createTransport failed to connect to {” library=grpc  
Jun 05 11:50:58 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:50:58.721808791Z” level=debug msg=" "Addr": "localhost"," library=grpc  
Jun 05 11:50:58 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:50:58.721813951Z” level=debug msg=" "ServerName": "localhost"," library=grpc  
Jun 05 11:50:58 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:50:58.721817898Z” level=debug msg=" "Attributes": null," library=grpc  
Jun 05 11:50:58 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:50:58.721821385Z” level=debug msg=" "BalancerAttributes": null," library=grpc  
Jun 05 11:50:58 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:50:58.721824711Z” level=debug msg=" "Type": 0," library=grpc  
Jun 05 11:50:58 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:50:58.721828698Z” level=debug msg=" "Metadata": null" library=grpc  
Jun 05 11:50:58 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:50:58.721831995Z” level=debug msg=“}. Err: connection error: desc = "transport: Error while dialing only one connection allowed"” library=grpc  
Jun 05 11:52:33 sdx1-kvm dockerd[59654]: time=“2023-06-05T11:52:33.724284994Z” level=warning msg=“leaked execError detected and released”

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [June 7, 2023, 9:23am UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/6 "2023-06-07T09:23:53Z")

</div>

Any suggestion regarding this “Error while dialing only one connection allowed” with grpc?

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [June 9, 2023, 5:20pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/7 "2023-06-09T17:20:55Z")

</div>

can you provide information about where you are running the make command? is this on a linux VM? if so which OS and version, and which docker version are you using?

AWX Team

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [June 9, 2023, 6:15pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/8 "2023-06-09T18:15:11Z")

</div>

- Ubuntu 23.04 lunar on a KVM VM running on a similar host
- docker-ce 5:24.0.2-1~ubuntu.23.04~lunar from the official docker PPA (deb [arch=amd64] [https://download.docker.com/linux/ubuntu](https://download.docker.com/linux/ubuntu) lunar stable edge)
- python3.9 3.9.5-3ubuntu0~21.04.1 (backported from Ubuntu hirsute 21.04)
- pip/wheel/ansible/docker/docker-compose/redis/setuptools-scm installed from PyPi using pip3 inside a virtual env

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [June 14, 2023, 3:57pm UTC](https://forum.ansible.com/t/could-not-resolve-host-mirrors-centos-org-during-the-build-of-the-docker-container-image/38050/9 "2023-06-14T15:57:14Z")

</div>

Exact same issue with:

- Ubuntu **22.04 jammy LTS** on a KVM VM
- docker-ce 5:24.0.2-1~ubuntu.22.04~jammy from the official docker PPA (deb [arch=amd64] [Index of linux/ubuntu/](https://download.docker.com/linux/ubuntu) jammy stable edge)
- python3.9 3.9.17-1+jammy1 (from [Index of /deadsnakes/ppa/ubuntu](https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu) jammy/main amd64 Packages)
- pip/wheel/ansible/docker/docker-compose/redis/setuptools-scm installed from PyPi using pip3 inside a virtual env

Same strange grpc error:

# echo q | systemctl --no-pager --full status docker

● docker.service - Docker Application Container Engine  
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)  
Active: active (running) since Wed 2023-06-14 15:43:04 UTC; 11min ago  
TriggeredBy: ● docker.socket  
Docs: [https://docs.docker.com](https://docs.docker.com)  
Main PID: 211829 (dockerd)  
Tasks: 12  
Memory: 214.3M  
CPU: 4.695s  
CGroup: /system.slice/docker.service  
└─211829 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Jun 14 15:45:59 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:45:59.935797363Z” level=debug msg=“ReleaseAddress(LocalDefault/172.17.0.0/16, 172.17.0.3)”  
Jun 14 15:45:59 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:45:59.935818162Z” level=debug msg=“Released address Address:172.17.0.3 Sequence:Bits: 65536, Unselected: 65533, Sequence: (0xc0000000, 1)-\>(0x0, 2046)-\>(0x1, 1)-\>end Curr:5”  
Jun 14 15:46:03 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:46:03.897765133Z” level=debug msg=“2023/06/14 15:46:03 WARNING: [core] [Channel #11 SubChannel #12] grpc: addrConn.createTransport failed to connect to {” library=grpc  
Jun 14 15:46:03 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:46:03.903195475Z” level=debug msg=" "Addr": "localhost"," library=grpc  
Jun 14 15:46:03 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:46:03.903237455Z” level=debug msg=" "ServerName": "localhost"," library=grpc  
Jun 14 15:46:03 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:46:03.903246712Z” level=debug msg=" "Attributes": null," library=grpc  
Jun 14 15:46:03 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:46:03.903254036Z” level=debug msg=" "BalancerAttributes": null," library=grpc  
Jun 14 15:46:03 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:46:03.903261229Z” level=debug msg=" "Type": 0," library=grpc  
Jun 14 15:46:03 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:46:03.903273694Z” level=debug msg=" "Metadata": null" library=grpc  
Jun 14 15:46:03 sdx1-kvm dockerd[211829]: time=“2023-06-14T15:46:03.903280757Z” level=debug msg=“}. Err: connection error: desc = "transport: Error while dialing only one connection allowed"” library=grpc
