Learn how to resolve the Docker build error message.

Temporary failure resolving ‘deb.debian.org’
Temporary failure resolving ‘security.debian.org’

You have to add the flag –network host to resolve this.

docker build --network host -t youtube:1.2 .

What is Docker build — Network host?
Docker network host, also known as Docker host networking, is a networking mode in which a Docker container shares its network namespace with the host machine. The application inside the container can be accessed using a port at the host’s IP address (e.g., port 80).

What network does Docker build use?
By default, docker uses the bridge network driver, which connects the containers to a network separate from the host.

Does Docker use host network?
If you specify the –net=host option to the docker create or docker run commands, Docker uses the host’s network stack for the container. The network configuration of the container is the same as that of the host and the container shares the service ports that are available to the host.

Xybernetics Docker Temporary failure resolving 'deb.debian.org'