How to edit Docker container files from the host?

The Solution to How to edit Docker container files from the host? is


The best way is:

  $ docker cp CONTAINER:FILEPATH LOCALFILEPATH
  $ vi LOCALFILEPATH
  $ docker cp LOCALFILEPATH CONTAINER:FILEPATH

Limitations with $ docker exec: it can only attach to a running container.

Limitations with $ docker run: it will create a new container.

~ Answered on 2016-12-21 23:27:51


Most Viewed Questions: