I'm trying to build our own docker container image with:
. /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
[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 \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from=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 0.4s
=> [internal] load metadata for quay.io/centos/centos:stream9 0.4s
=> importing cache manifest from ghcr.io/ansible/awx_devel:release_4.4 0.8s
=> [builder 1/10] FROM 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 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
------
> [builder 3/10] RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' && dnf config-manager --set-enabled crb && dnf -y install gcc gcc-c++ git-core gettext glibc-langpack-en libffi-devel libtool-ltdl-devel make nodejs nss openldap-devel patch postgresql postgresql-devel python3-devel python3-pip python3-psycopg2 python3-setuptools swig unzip xmlsec1-devel xmlsec1-openssl-devel:
#0 0.413 /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
#0 0.471 Failed to set locale, defaulting to C.UTF-8
#0 74.30 CentOS Stream 9 - BaseOS 0.0 B/s | 0 B 01:13
#0 74.30 Errors during downloading metadata for repository 'baseos':
#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 [Could not resolve host: mirrors.centos.org]
#0 74.31 Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: 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 [Could not resolve host: mirrors.centos.org]
------
------
> [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 git-core git-lfs glibc-langpack-en krb5-workstation nginx "openldap >= 2.6.2-3" postgresql python3-devel python3-libselinux python3-pip python3-psycopg2 python3-setuptools rsync rsyslog-8.2102.0-106.el9 subversion sudo vim-minimal which unzip xmlsec1-openssl && dnf -y clean all:
#0 0.412 /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
#0 0.471 Failed to set locale, defaulting to C.UTF-8
#0 74.30 CentOS Stream 9 - BaseOS 0.0 B/s | 0 B 01:13
#0 74.30 Errors during downloading metadata for repository 'baseos':
#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&countme=1 [Could not resolve host: mirrors.centos.org]
#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 [Could not resolve host: mirrors.centos.org]
#0 74.31 Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: 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 [Could not resolve host: mirrors.centos.org]
------
Dockerfile.dev:82
--------------------
81 | # Install runtime requirements
82 | >>> RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' && \
83 | >>> dnf config-manager --set-enabled crb && \
84 | >>> dnf -y install acl \
85 | >>> git-core \
86 | >>> git-lfs \
87 | >>> glibc-langpack-en \
88 | >>> krb5-workstation \
89 | >>> nginx \
90 | >>> "openldap >= 2.6.2-3" \
91 | >>> postgresql \
92 | >>> python3-devel \
93 | >>> python3-libselinux \
94 | >>> python3-pip \
95 | >>> python3-psycopg2 \
96 | >>> python3-setuptools \
97 | >>> rsync \
98 | >>> rsyslog-8.2102.0-106.el9 \
99 | >>> subversion \
100 | >>> sudo \
101 | >>> vim-minimal \
102 | >>> which \
103 | >>> unzip \
104 | >>> xmlsec1-openssl && \
105 | >>> dnf -y clean all
106 |
--------------------
ERROR: failed to solve: process "/bin/sh -c dnf -y update && dnf install -y 'dnf-command(config-manager)' && dnf config-manager --set-enabled crb && dnf -y install acl git-core git-lfs glibc-langpack-en krb5-workstation nginx \"openldap >= 2.6.2-3\" postgresql python3-devel python3-libselinux python3-pip python3-psycopg2 python3-setuptools rsync rsyslog-8.2102.0-106.el9 subversion sudo vim-minimal which unzip xmlsec1-openssl && dnf -y clean all" did not complete successfully: exit code: 1
make: *** [Makefile:572: docker-compose-build] Error 1
There is no such DNS resolution issue on the host (which is a KVM VM):
The iptables rules are automatically defined for the docker0 linux bridge:
# grep -i docker /etc/iptables/rules.v4
:DOCKER - [0:0]
:DOCKER-ISOLATION-STAGE-1 - [0:0]
:DOCKER-ISOLATION-STAGE-2 - [0:0]
:DOCKER-USER - [0:0]
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-ISOLATION-STAGE-1
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -o docker0 -j DOCKER
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
-A DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2
-A DOCKER-ISOLATION-STAGE-1 -j RETURN
-A DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP
-A DOCKER-ISOLATION-STAGE-2 -j RETURN
-A DOCKER-USER -j RETURN
:DOCKER - [0:0]
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT ! -d
127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
-A POSTROUTING -s
172.17.0.0/16 ! -o docker0 -j MASQUERADE
-A DOCKER -i docker0 -j RETURN
I have also disabled the Source Address Verification for docker0 in /etc/sysctl.d/10-network-security.conf:
echo "net.ipv4.conf.docker0.rp_filter=0" >> /etc/sysctl.d/10-network-security.conf
systemctl restart systemd-sysctl.service
By default, containers inherit the DNS settings of the host, as defined in the /etc/resolv.conf configuration file
in the host /etc/resolv.conf:
nameserver 8.8.4.4
But since the issue is there, I also tried to define the DNS server in /etc/docker/daemon.json:
{
"debug": true,
"dns": ["8.8.4.4"],
"ipv6": false
}
I'm running out of options and I don't understand why this is happening.
Any suggestion/explanation?