Quantcast
Viewing latest article 12
Browse Latest Browse All 29

Answer by hkong for How do I edit a file after I shell to a Docker container?

If you don't want to add an editor just to make a few small changes (e.g., change the Tomcat configuration), you can just use:

docker cp <container>:/path/to/file.ext .

which copies it to your local machine (to your current directory). Then edit the file locally using your favorite editor, and then do a

docker cp file.ext <container>:/path/to/file.ext

to replace the old file.


Viewing latest article 12
Browse Latest Browse All 29

Trending Articles