DEV Community

tetractius
tetractius

Posted on

TetraQuicky09: Get back autocomplete in a Docker container

How many time you shouted as crazy because you could get autocomplete in an ubuntu docker container...

Well: that's life; it is like this by design for a gazillion of very good reasons. Never the less if you are not a genius that can manage to get a container working at the first untested write of the Dockerfile, chances are that you need to -it /bin/bash in a container to understand what the hell it's going on.

And it is there where you understand that life has been unfair with you. You don't have the auto-complete.

But, getting it back, is very easy...

Just install the bash autocompletion:

$ apt-get install bash-completion

and remove one file

$ rm /etc/apt/apt.conf.d/docker-clean

then you have to exit from there...
The container will die. Again: that's life.
But if you docker ps -a you get the id of the container you just kill it and you restart it and you attach to it...

docker start <last container>
docker attach <last container>

a couple of ENTER keys and... Voila'!!

You can TAB ... TAB all your life that has been wasted so far in cmd.com not tab tabbing. :)

Peach, stay home and stay safe!!

Top comments (0)