Is there a way to pass additional CLI arguments to...
# general
f
Is there a way to pass additional CLI arguments to the
docker build
command generated by a
docker image
target? For some reasons I’m installing dependencies into my image with
pip
. I’d like to be able to cache those layers in the GitHub Actions cache, but to do that I need to set the
--cache-to
and
--cache-from
options on the CLI. See: https://docs.docker.com/build/cache/backends/local/ Is that possible in the
BUILD
or
pants.toml
file? I didn’t see an option that looked like a generic
args
thing, although I do see the appropriate mixin classes in
backend/docker/target_types.py
c
the current answer is unfortunately no. The next best thing as work around that has been explored is to use a
docker
shim script where you may hi-jack the build command and tweaks the args as appropriate for you.
f
Thanks @curved-television-6568!
I’ll look into that. Is there appetite for adding this to pants directly?
c
There’s a need for fixing this for sure. I’m not currently on a system using Docker, so my contributions towards that backend is very limited for the time being however.
f
If this is something the project overall is interested in, I might be able to squeeze a few hours from my employer to look at it
c
Thanks, yea that would be great. Also, I’ll be available if you’d need any guidance along the way.
f
Thanks!
b
f
Thanks!