Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

My bitbucket build cannot pull docker image

Jason Novotny January 9, 2023

Previously I was using

image: openkbs/jdk11-mvn-py3

and this worked fine. Then I forked that docker image to fingage/jdk17-mvn-py3 and made sure it was public and changed the line:

image: fingage/jdk17-mvn-py3

 Now I get an error

rpc error: code = Unknown desc = failed to pull and unpack image "docker.io/fingage/jdk17-mvn-py3:latest": failed to resolve reference "docker.io/fingage/jdk17-mvn-py3:latest": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

any ideas?

Thanks, Jason

1 answer

1 accepted

0 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2023

Hello @Jason Novotny 

Thank you for reaching out to Atlassian Community!

The error you reported is because that image either does not exist or is a private image. If you access the fingage repository in Dockerhub you can check that there's currently no public image listed with the name jdk17-mvn-py3.

If the image is private, you can use the following syntax in your Bitbucket pipelines yml file to provide the Docker hub credentials :

image:
  name: fingage/jdk17-mvn-py3
  username: $DOCKER_HUB_USERNAME
  password: $DOCKER_HUB_PASSWORD

However, if you want to set the image as public in your docker hub repository, you can follow Dockerhub's documentation to Configure repositories.

Hope that helps! Let me know in case you have any questions.

Thank you, @Jason Novotny .

Patrik S

Jason Novotny January 11, 2023

Thanks Patrik! That was very helpful

Like Patrik S likes this
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 11, 2023

You're very welcome @Jason Novotny ! Happy to have been of some help :) 

ferpaxecosanxez April 4, 2023

Does not run with "docker hub" images?

I have this YML:

## Depth to clone project
clone:
depth: full

## Use S4G image to manage Salesforce code
image:
## Use image from private Docker Hub
name: s4gconsulting/devkops:latest
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
email: $DOCKER_HUB_EMAIL

pipelines:
default:
- step:
name: Validate Docker Image
script:
- echo "Private image was pulled"

The result returns a right private image code SHA

Screenshot 2023-04-04 at 18.54.07.png

But I have this error:

Screenshot 2023-04-04 at 18.48.48.png

Any ideas? Thanks =)

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2023

Hello @ferpaxecosanxez ,

The syntax you have used seems to be correct. Does the UI show any error message when you expand the Build setup section of the logs? 

I would recommend trying to re-run the build and check if any error message is shown. If the authentication is wrong, it would be expected that an error would be shown saying that pipeline was not able to pull the image.

Also, make sure that the DOCKER_HUB_USERNAME, DOCKER_HUB_PASSWORD, and DOCKER_HUB_EMAIL are defined as environment variables in the repository or workspace level (see Variables and Secrets ), and that they don't contain any typo/space that might be causing an error when authenticating with docker hub.

Thank you, @ferpaxecosanxez !

Patrik S

ferpaxecosanxez April 5, 2023

Hello @Patrik S , the UI does not show errors and the image was pulled correctly. I have opened this question where I use public images but with the same fail result.

There you have all details and I hope that the community can help me.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events