Unable to install vim or nano inside docker container

quarks picture quarks · May 11, 2016 · Viewed 64.3k times · Source

Trying to install inside a docker, either vim or nano but I only get this:

0% [Connecting to archive.ubuntu.com (91.189.88.152)]

Exit docker and do ping archive.ubuntu.com and I get reply, do the same time inside docker it does not respond.

What could be the problem?

Answer

Troncador picture Troncador · May 11, 2016

First I create the docker:

sudo docker run -t -i ubuntu /bin/bash

Instead of this you can enter in a running docker with his number or name:

sudo docker exec -it be8aa338d656 bash

Then inside the docker run this code:

apt-get update
apt-get install vim nano