$ docker container run -d -it --name my_ubuntu ubuntu:xenial
Note: make sure the DNS works fine in the container.
root@9b7xxx:/# apt update root@9b7xxx:/# apt install curl
You can use 'Ctrl+pq' to exit the container without stopping it cause the CMD is running '/bin/bash' by default.
$ docker container attach my_ubuntu