I have a the following docker file:
FROM my-reg:7678/py:v11
copy . /app/
# more commands...
I want to copy the content of .
without 2 sub-folders: .git
and data
I can't use .dockerignore
because some docker files use the folder data
and some are not.
(the docker files which use data
folder use the copy . /app/
command)
The solution here: COPY with docker but with exclusion
is not fit for me:
I want to let the docker file to decide to use or not .dockerignore
. and It seems not efficient to copy the folder and after it to remove some sub folders.
- Is there a way to give
copy
command sub folders to ignore ? - Is there a way to instruct the docker file to use
.dockerignore
file or to ignore it ?