The COPY instruction adds files, directories, or tarballs from the local build host to a specified path in the image filesystem. It is commonly used after FROM has established the image's base root filesystem. section 2.3.1
During podman build, Podman mounts the base image through container storage and a copy-on-write filesystem. COPY then adds content to the newly created rootfs as the image is built. section 2.3.1
Use COPY to:
- Transfer build-context files into application or configuration paths inside the image. section 2.3.2
- Populate an image created from FROM scratch or extend an existing base image. section 2.3.1
- Keep build-time commands separate from file transfer: RUN executes commands during construction, while COPY adds files. section 2.3.1
Copy an application page
Place index.html and a Containerfile in the myapp context directory, then write COPY index.html /var/www/html/index.html. Build it with podman build -t quay.io/rhatdan/myimage ./myapp. section 2.3.2
Table 2.6 Containerfile directives that update the image (view table figure)
Compare COPY with ADD, RUN, FROM, and other directives that update an image. section 2.3.1

