Skip to content

saukrs/docker-edit-file-CLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of docker …​ edit command

The Bash shim/function to emulate editing Docker guest file from the Docker host.

To achieve that the script:

  • copies the guest file to temporary file on the host;

  • launches the editor for that file;

  • checks if editor indicates sucessful exit;

  • in the positive case the file is copied back to the guest.

Using

Source the file in you Bash any way you like, eg:

$ . docker-edit-file-CLI/bash-function-docker-edit

To be sure for the 1st time, maybe check the result:

$ declare -f docker

Then run the new, emulated docker edit command:

$ docker [OPTIONS] edit CONTAINER GUEST_FILE

Eg:

$ docker edit mongo /etc/hosts

After successful write and exit, the content should appear on the guest.

License

Blue Oak Model License (Version 1.0.0) - a modern alternative to the MIT license.

About

Edit files on Docker guests using CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages