How to copy files temporarily in Dockerfile
It’s very common to copy a local file into the container when build docker image. In general, we use COPY command. But it creates a new layer and increase the final image size. If this is a temporal file and we don’t want users waste their storage space, how can we remove it? Here are some approaches.
Download the File Dynamically
If the file can be download from URL or you can create a local HTTP server to share the file, you can download the file, use it and delete it in one RUN command. For example:

