bazelbuild / rules_docker

Rules for building and handling Docker images with Bazel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Desktop Client Config

rhollencamp opened this issue Β· comments

🐞 bug report

Affected Rule

container_push

Is this a regression?

no

Description

Attempting to push containers with docker config "credsStore": "desktop" fails; docker-credential-desktop expects both $HOME and $USER to be populated. This can be seen with

$ unset HOME
$ unset USER
$ echo 'some-url' | docker-credential-desktop get
Failed to fire hook: while creating logrus local file hook: user: Current requires cgo or $USER, $HOME set in environment

If I set HOME and USER with --action_env the push succeeds.

πŸ”₯ Exception or Error


INFO: Analyzed target //cargurus-embankment/paas/proxinator:proxinator-run-push (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
[0 / 3] [Prepa] BazelWorkspaceStatusAction stable-status.txt
ERROR: /Users/rhollencamp/cargurus/cg-main/cargurus-embankment/paas/proxinator/BUILD:52:18: Executing genrule //cargurus-embankment/paas/proxinator:proxinator-run-push failed (Exit 1): bash failed: error executing command 
  (cd /private/var/tmp/_bazel_rhollencamp/6eee4b07057dde9bd2712a94cd7516d6/sandbox/darwin-sandbox/125/execroot/com_cargurus && \
  exec env - \
    PATH=/Users/rhollencamp/Library/Caches/bazelisk/downloads/bazelbuild/bazel-3.7.2-darwin-x86_64/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/bin \
  /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; /bin/bash bazel-out/darwin-py2-fastbuild/bin/cargurus-embankment/paas/proxinator/proxinator-push; date > bazel-out/darwin-py2-fastbuild/bin/cargurus-embankment/paas/proxinator/proxinator-run-push.txt')
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox bash failed: error executing command 
  (cd /private/var/tmp/_bazel_rhollencamp/6eee4b07057dde9bd2712a94cd7516d6/sandbox/darwin-sandbox/125/execroot/com_cargurus && \
  exec env - \
    PATH=/Users/rhollencamp/Library/Caches/bazelisk/downloads/bazelbuild/bazel-3.7.2-darwin-x86_64/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/bin \
  /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; /bin/bash bazel-out/darwin-py2-fastbuild/bin/cargurus-embankment/paas/proxinator/proxinator-push; date > bazel-out/darwin-py2-fastbuild/bin/cargurus-embankment/paas/proxinator/proxinator-run-push.txt')
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
2023/01/18 18:04:17 Destination {STABLE_DOCKER_REGISTRY}/{STABLE_DOCKER_REPO_ROOT}/services/proxinator:{VOLATILE_IMAGE_TAG} was resolved to [...] after stamping.
Failed to fire hook: while creating logrus local file hook: user: Current requires cgo or $USER, $HOME set in environment
[2023-01-18T23:04:17.316459000Z][docker-credential-desktop][F] user: Current requires cgo or $USER, $HOME set in environment
[common/pkg/paths.Home()
[	common/pkg/paths/paths.go:105 +0x58
[common/pkg/paths.Container()
[	common/pkg/paths/user_darwin.go:30 +0x1c
[common/pkg/paths.Data()
[	common/pkg/paths/paths_darwin.go:27 +0x1c
[common/pkg/paths.setCurrentDirectory()
[	common/pkg/paths/paths.go:61 +0x20
[common/pkg/paths.Init(0x0?)
[	common/pkg/paths/paths.go:45 +0x20
[main.main()
[	common/cmd/docker-credential-desktop/main.go:50 +0x3c

🌍 Your Environment

Operating System:

  
macOS 12.6.2
  

Output of bazel version:

  
Build label: 3.7.2
  

Rules_docker version:

  
0.16.0
  

Anything else relevant?

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"