Hi! docker has the ability to mount dirs when doin...
# general
w
Hi! docker has the ability to mount dirs when doing a build. E.g. you can mount the pip cache folder during build time so that you can persist the cache between docker build invocations. Is there a way to pass this in for docker_image? Woops this is available in a RUN command in the buildfile
e
I was not aware you could mount volumes during a
docker build
like you could during
docker run
- how do you do this - Pants aside - @wonderful-boots-93625?
w
Ah sorry looks like I'm mistaken, its passed through a RUN in docker file
e
Ok. Yeah - I was looking for that capability recently with some Pex infra docker work and could not find any way to do so.
w
e
Ah, ok
# syntax = docker/dockerfile:experimental
.
Hopefully when it graduates from an experiment they'll remove that weird RUN hack or else at least add a
docker build --volume ...
option to use instead. I'm guessing I'm missing something obvious though about why a flag is a no-go.
w
yup, although not sure if this is in base docker by now.
e
If it must be in
RUN ...
I'm guessing it has to do with proper layer caching - somehow.