Hi,
I have docker containers in a RHEL 8 server. The server has not access to Internet and is in a corporate network. I have loaded docker containers to the server using the docker load command using .tar files of the modules. After loading the .tar files I am able to see the images using the - sudo docker images command.
But when I try to see the running containers using - sudo docker ps -a, then it does not show any running containers.
I have added the host entry in the /etc/hosts file the fqdn and corresponding private IP.
On checking logs it says -
caused by: Container on the default network could not connect to fqdn:port
caused by: docker returned exit status: 1, stderr = One or more errors occurred. (Name does not resolve)
On running nslookup command in the server it gives:
nslookup fqdn
server: 127.0.0.1
Address: 127.0.0.1#53
** server can’t find fqdn: NXDOMAIN
On running nc command it works fine and is able to resolve the fqdn to the private IP.
It doesn’t work that way. Even though your host is able to use the entry from /etc/hosts ( e.g. for ping, curl), a tool that relies on querying a dns server won’t know anything about it.
I must admit, I still have no idea about what the actual situation is. The only things we know are that you are in an air-gapped environment, loaded images from tars into docker’s local image cache, and that you can’t see any running containers. And we know that you somehow have problems with dns, but don’t know why it’s relevant.
I am afraid you have to provide way more details than that. Please share the exact commands and outputs you received, so we actually understand things.