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

后端 未结 16 1890
你的背包
你的背包 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 14:54

    To keep your Docker images small, don't install unnecessary editors. You can edit the files over SSH from the Docker host to the container:

    vim scp://remoteuser@containerip//path/to/document
    

提交回复
热议问题