hi :wave: I'm having issues with pants v2.16 and d...
# general
b
hi 👋 I'm having issues with pants v2.16 and docker authentication (for GCR in particular). I have followed the relevant guide in the docs (this thread seems to be relevant too) but the problem persists. Pants configuration for docker has
env_vars = ["DOCKER_CONFIG=%(homedir)s/.docker"]
, also tried with
$(env.HOME)
. In both cases I can't find the config file in the sandbox (should be ~/.docker/config.json -> <sandbox_path>/.docker/config.json right?) which is probably why authentication fails. Looking at the command to build the image (with
-ldebug
on), I only see PATH defined in env (and
__UPSTREAM_IMAGE_IDS
) but no DOCKER_CONFIG.. Is it possible that the env var is ignored? Not sure where else to look for issues, any suggestions are welcome 🙏
ok I can perhaps narrow the scope down a bit; if I'm not using environments, the build proceeds and I can indeed see the env_vars defined in the docker section. Turning environments on seems to cause the problem, I'm now trying to narrow it down some more.
looks like local_environment drops env_vars from the docker section? using docker_env_vars I can see DOCKER_CONFIG in the command, however there's no interpolation there (e.g., %(homedir)s doesn't work)
setting the absolute path fixes the issue however this is not a desirable solution 😞
@curved-television-6568 not sure if it's a bug or lack of documentation here, but certainly a painful experience for me 😅
c
sorry for the troubles. I’ve no experience with using environments but know there are some remaining rough edges with environments and docker esp wrgt env vars. ping @witty-crayon-22786 @fast-nail-55400 may know more..
b
no worries. I hit a wall so thought I'd better call in the cavalry 😄 On the positive side, I learned more about pants 👍
🙏 1
👍 1