How do I edit a file after I shell to a Docker container?

后端 未结 16 1957
你的背包
你的背包 2020-11-29 14:22

I successfully shelled to a Docker container using:

docker exec -i -t 69f1711a205e bash

Now I need to edit file and I don\'t have any edito

16条回答
  •  不知归路
    2020-11-29 15:07

    For common edit operations I prefer to install vi (vim-tiny), which uses only 1491 kB or nano which uses 1707 kB.

    In other hand vim uses 28.9 MB.

    We have to remember that in order for apt-get install to work, we have to do the update the first time, so:

    apt-get update
    apt-get install vim-tiny
    

    To start the editor in CLI we need to enter vi.

提交回复
热议问题