As far as I understand, a container is something like a sandboxed operating system. Isolated from the other processes and from computer networks unless explicitly allowed.
However, you can just:
docker run -it ubuntu
then go on to install curl
and basically do anything on the Internet. Note that no ports have been exposed for the container. This means that my understanding of the isolation concept is wrong.
How can a container communicate with the Internet when no ports have been exposed?