Cannot connect to internet from inside a docker container in Ubuntu VM

Gabriel Castillo 0 Reputation points
2024-12-18T05:39:59.78+00:00

Hi,

I am trying to access internet from inside docker containers in an Ubuntu VM. According to the azure documentation found here: https://zcusa.951200.xyz/en-us/azure/virtual-network/deploy-container-networking#deploy-plug-in-for-docker-containers

I deployed the plugin, also created the container using the command ./docker-run.sh ... but still there is no internet access from inside the container, I am not able to run any commands in the container like ping, curl, apt-get, etc so Internet is not yet enabled in the docker container.

Is there a way that I can troubleshoot or test that conectivity to internet from inside the docker container?

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
468 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,179 questions
{count} votes

1 answer

Sort by: Most helpful
  1. akinbade abiola 21,130 Reputation points
    2024-12-18T11:46:21.28+00:00

    Hello Gabriel Castillo,

    Thanks for your question.

    Try the following as torubleshooting steps to pindown the issue:

    Check Docker network configuration

    docker network ls
    docker network inspect bridge
    

    Inspect the specific container's network details

    docker inspect <container_name>

    Verify DNS configuration inside the container:

    cat /etc/resolv.conf

    Test network connectivity from the host itself to see if its a host issue

    ping 8.8.8.8
    ping google.com
    

    Also see the stackoverlow post for an ubuntu machine https://stackoverflow.com/questions/73313328/how-to-troubleshoot-docker-network-issues

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.