When ADDing a file through build docker image, you need to use the ADD or COPY keyword, but add or COPY can only be followed by a directory or file relative to the path of the directory where the Dockerfile file is located. is there a way to transfer the directory or file through an absolute path? (Looks like docker has a cp command in it, but only files or directories can be copied from the container to the local machine, not from the local machine to the container. (Why? ? ））
Docker’s cp command can be copied out of the container or from a container copied locally.
docker cp more.log e7de404c00bd:/tmp/
docker help cp Usage: docker cp [OPTIONS] CONTAINER:PATH LOCALPATH|- docker cp [OPTIONS] LOCALPATH|- CONTAINER:PATH Copy files/folders between a container and your host. Use '-' as the source to read a tar archive from stdin and extract it to a directory destination in a container. Use '-' as the destination to stream a tar archive of a container source to stdout.