Docker Community Forums

Share and learn in the Docker community.

Docker on the network

Guys, good morning.

I’m facing a difficulty with the containers. Use the commands to create a network and go beauty, the content to get IP, but not internet. What is not contained within the network that creates, but the container can not be accessed on the internet. I immediately start an APT-GET UPDATE inside the container to perform the installation of the dependencies, but it will not go because it is not connected to the internet.

I used the command to create a network:

docker network create -d macvlan --subnet = / 24 --gateway = -the father = enp2s0 macvlan_teste

And soon I create the container inside the network

docker execution --net = macvlan_teste -itd --name = cont1 ubuntu: 18.04

then I enter the container with the command:

docker exec --privileged -it cont1 / bin / bash

I try to get an UPDATE but it will not because it does not access the internet.

Can you help me?