-1

While trying to deploy a a docker container in Cent-OS getting the following error ( DNS not resolving inside the container)

error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads https://github.com/Asymmetrik/node-fhir-server-core.git
Directory: /srv/cpr-fhir
Output:
fatal: unable to access 'https://github.com/Asymmetrik/node-fhir-server-core.git/': Could not resolve host: github.com

**Operating System: CentOS Linux 8 (Core)
Docker version: Version:           19.03.7**
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Anish Varghese
  • 3,450
  • 5
  • 15
  • 25

1 Answers1

0

Actually this is happen because docker container not using the native DNS.

Fix

Go to the docker configuration file /lib/systemd/system/docker.service

append the dns variable in the ExecStart command as follows

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --dns 8.8.8.8

Anish Varghese
  • 3,450
  • 5
  • 15
  • 25