Complete the command to copy a file named app.log from your local machine to a running container named webapp.
docker cp app.log [1]:/var/log/The correct syntax to copy a file into a container is docker cp source_path container_name:destination_path. Here, webapp:/var/log specifies the container and the destination folder.
Complete the command to copy a file named config.yaml from a container named db to your local directory /configs.
docker cp [1]:/etc/config.yaml /configs/To copy a file from a container, specify container_name:path_to_file. Here, db:/etc/config.yaml points to the exact file inside the container.
Fix the error in the command that tries to copy data.csv from the container analytics to the current directory.
docker cp analytics[1]data.csv .The correct syntax requires a colon and a slash to separate the container name and the file path: container_name:/path/to/file. So analytics:/data.csv is correct.
Fill both blanks to copy the entire directory /app/data from the container backend to the local directory ./backup.
docker cp [1] [2]
The source is the directory inside the container: backend:/app/data. The destination is the local directory: ./backup.
Fill all three blanks to copy the file settings.json from the local directory ./configs to the container frontend inside the path /usr/src/app/config.
docker cp [1]/[2] [3]:/usr/src/app/config/
The source is the local file path: ./configs/settings.json. The destination is the container and path: frontend:/usr/src/app/config/.