I want to make a folder on my host machine available during a RUN statement. That is, similar to the effect of a container run with -v:
docker run -v /path/on/host:/path/in/container mycontainer:tag
In the container this gives me /path/in/container with all files/folder in path/on/host.
To this end I am trying the experimental mount options from https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/experimental.md:
RUN --mount=type=bind,target=/path/on/host
This gives me a folder /path/on/host during the RUN.
I then have two problems:
I can
lsfiles inside/path/on/host, but not use them (e.g.catthem). I have tried changingtypeto e.g.cacheand usingsourcelike in https://devops.stackexchange.com/questions/6078/in-a-dockerfile-is-there-a-way-to-avoid-copying-files-to-make-them-accessible-t, but I cannot make it work.I cannot figure out how to have a different path inside the "
RUNimage", that is,/path/in/containerinstead of/path/on/host.