Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to fetch builder image from Google Repository without installing "docker-credential-gcloud" #728

Closed
ratnadeep007 opened this issue Jul 2, 2020 · 8 comments
Labels
type/bug Issue that reports an unexpected behaviour.

Comments

@ratnadeep007
Copy link

Summary

When trying to build with image hosted in Google Container Registry it throws error: failed to fetch builder image 'gcr.io/paketo-buildpacks/builder:tiny': error getting credentials - err: exec: "docker-credential-gcloud": executable file not found in $PATH, out:

Even when I downloaded the image using pull command it throws same error.
Why do we need docker-credential-gcloud for public images?


Reproduction

Steps
  1. Try to build using any builder hosted in Google Registry without docker-credential-gcloud installed
Current behavior

Throws error: failed to fetch builder image 'gcr.io/paketo-buildpacks/builder:tiny': error getting credentials - err: exec: "docker-credential-gcloud": executable file not found in $PATH, out:

Expected behavior

Download and start building image


Environment

pack info

Pack:
Version: 0.11.2+git-063a80d.build-677
OS/Arch: darwin/amd64

Default Lifecycle Version: 0.7.5

Config:
(no config file found at /Users/ratnadeep/.pack/config.toml)

docker info

Client:
Debug Mode: false

Server:
Containers: 24
Running: 22
Paused: 0
Stopped: 2
Images: 16
Server Version: 19.03.8
Storage Driver: overlay2
Backing Filesystem:
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.19.76-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.944GiB
Name: docker-desktop
ID: G4FB:7DRL:BFKN:J3FT:PD4X:37JY:EZZL:PIU5:QORT:HMJU:JHXW:PDHE
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 159
Goroutines: 143
System Time: 2020-07-02T12:19:22.845297323Z
EventsListeners: 3
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

@ratnadeep007 ratnadeep007 added status/triage Issue or PR that requires contributor attention. type/bug Issue that reports an unexpected behaviour. labels Jul 2, 2020
@ratnadeep007 ratnadeep007 changed the title Failed to fetch builder image from Google Repository without login Failed to fetch builder image from Google Repository without installing "docker-credential-gcloud" Jul 2, 2020
@jromero
Copy link
Member

jromero commented Jul 2, 2020

pack shared the same authentication mechanism as docker. Commonly located in ~/.docker/config.json. Furthermore, the registry client we use doesn't do a "pre-check" to determine if the image is public. Instead, the config (mentioned prior) is checked as to whether the domain (gcr.io) has authentication associated, if so it attempts to use it. In this case it uses what is called a credentials-helper which appears to be missing.

@dfreilich
Copy link
Member

This probably means that gcloud was installed, but is no longer on your path. You can see buildpacks/docs#129 (comment) where I had the same issue. Feel free to reopen if setting gcloud up doesn't resolve your issue!

@SyedAsimAliSE
Copy link

pack build paketo-demo-app -p . — builder gcr.io/paketo-buildpacks/builder:base

it returns

ERROR: failed to build: failed to fetch builder image ‘gcr.io/paketo-buildpacks/builder:base’: error getting credentials — err: exec: “docker-credential-gcloud”: executable file not found in %PATH%, out:

i don’t use gcr i use only Docker registry on my windows env.

anything else i am missing ?

@dfreilich
Copy link
Member

i don’t use gcr i use only Docker registry on my windows env.

In your case, you are using a builder which is located on gcr - that being the paketo-buildpacks/builder:base builder.

Would you be able to see whether you have gcloud configured in my $HOME/.docker/config.json?

@SyedAsimAliSE
Copy link

yes i can see the gcr.io stuff in the configs , below is the content from that file.

{"HttpHeaders":{"User-Agent":"Docker-Client/19.03.8 (windows)"},"auths":{"https://index.docker.io/v1/":{}},"credHelpers":{"gcr.io":"gcloud","us.gcr.io":"gcloud","eu.gcr.io":"gcloud","asia.gcr.io":"gcloud","staging-k8s.gcr.io":"gcloud","marketplace.gcr.io":"gcloud"},"credsStore":"desktop","experimental":"enabled","stackOrchestrator":"swarm"}

@ratnadeep007
Copy link
Author

ratnadeep007 commented Jul 9, 2020

Similar issue as of @SyedAsimAliSE, same config.json only difference is OS which is mac in my case

@dfreilich
Copy link
Member

That would make sense then. Assumedly at some point you had gcloud installed, which wrote itself to the .docker/config.json. The easiest solution in this case is just to download gcloud, install it, and see whether that helps. Let me know if it doesn't!

@SyedAsimAliSE
Copy link

Thank you for the link, it worked after installing the sdk.

@jromero jromero removed the status/triage Issue or PR that requires contributor attention. label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issue that reports an unexpected behaviour.
Projects
None yet
Development

No branches or pull requests

4 participants