I need to create a docker file that copies the MyApp directory to an image.
MyApp -libs -classes -resources
The Libs directory has about 50 MB, and it does not change often when the Classes directory is about 1 MB, and it undergoes frequent changes. To optimize the docker build, I planned to add the Libs directory at the beginning of the Docker file and add other directories at the end of the Docker file. My current approach is similar to this
ADD MyApp/libs /opt/MyApp/libs
This format is not supported, as in the future I may have some other directories in the MyApp directory that will be copied to the docker image. My goal is to write a docker file like this
ADD MyApp/libs /opt/MyApp/libs
Is there a similar command to exclude some files in the directory that is copied to the docker image?
source share