mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-27 02:53:08 +00:00
Update cheatsheets
This commit is contained in:
21
docker-cp
Normal file
21
docker-cp
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# docker cp
|
||||
|
||||
> Copy files or directories between host and container filesystems.
|
||||
> More information: <https://docs.docker.com/engine/reference/commandline/cp>.
|
||||
|
||||
- Copy a file or directory from the host to a container:
|
||||
|
||||
`docker cp {{path/to/file_or_directory_on_host}} {{container_name}}:{{path/to/file_or_directory_in_container}}`
|
||||
|
||||
- Copy a file or directory from a container to the host:
|
||||
|
||||
`docker cp {{container_name}}:{{path/to/file_or_directory_in_container}} {{path/to/file_or_directory_on_host}}`
|
||||
|
||||
- Copy a file or directory from the host to a container, following symlinks (copies the symlinked files directly, not the symlinks themselves):
|
||||
|
||||
`docker cp --follow-link {{path/to/symlink_on_host}} {{container_name}}:{{path/to/file_or_directory_in_container}}`
|
||||
Reference in New Issue
Block a user