echoing-farmer-15630
12/17/2021, 8:25 PMpants.toml
and
[docker]
env_vars=["DOCKER_BUILDKIT=1", "SSH_AUTH_SOCK"]
...so that I could get mount=type=ssh
working for ssh authentication, and that's where we go a bit wrong.
Running under pants, dockerfiles with RUN --mount=type=ssh
don't seem to work, even though in the generated __run.sh
includes the required
#!/bin/bash
# This command line should execute the same process as pants did internally.
export DOCKER_BUILDKIT=1 SSH_AUTH_SOCK=/tmp/path/to/ssh/agent/sock
cd /tmp/process-directory-tmp
/usr/bin/docker build -t $'my-tag' -f my-dockerfile .
if I cd
to that directory and run __run.sh
, everything builds. If I pants package my-docker-target
, which is what generated that file, it doesn't build and gives an ssh key error when downloading custom requirements from a private github repo.
Anything we can do about that? Am I missing a flag or is this a problem with the docker backend?curved-television-6568
12/17/2021, 8:41 PM__run.sh
script works, when it doesn’t when running with ./pants
.. I’ll dig into this a bit, but I’ll certainly need some assistance, as I’ve no experience with using ssh auth sock et al.curved-television-6568
12/17/2021, 8:42 PM__run.sh
as yourself, there’s some USER or HOME env vars set that presents some ssh keys that’s perhaps not present when running through pants.. ?curved-television-6568
12/17/2021, 8:44 PMechoing-farmer-15630
12/17/2021, 8:53 PMechoing-farmer-15630
12/17/2021, 8:54 PMechoing-farmer-15630
12/17/2021, 8:55 PMechoing-farmer-15630
12/20/2021, 1:57 PMdocker build ... --target dev
) and it doesn't look like the existing pants docker functionality allows that, so there's even less urgency, but I'm very excited to see this and begin using it. It is after all during Christmas week so no rush although if you want I can add tickets for these if they need them.curved-television-6568
12/20/2021, 3:03 PMcurved-television-6568
12/20/2021, 3:03 PM--target
option, and if it would be a requested feature. Happy to add it if it is something you need.