Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why my pipeline doesn't save my docker cache

I run my pipeline and at the end i have

in the Build teardown
a have
Assembling contents of new cache 'node'
The docker cache will consist of all unique layers from the following images:
XXXX latest 0b36a0e36fe1 2 minutes ago 2.89GB
XXXX master 0b36a0e36fe1 2 minutes ago 2.89GB
<none> <none> 2b8bbc83a9f5 2 minutes ago 2.88GB
<none> <none> 847beca8464e 2 minutes ago 2.88GB
<none> <none> f743250d3034 3 minutes ago 2.88GB
<none> <none> ab9f9a255307 3 minutes ago 2.87GB
<none> <none> ad702401ef7b 3 minutes ago 2.86GB
<none> <none> 27b2c6836e41 4 minutes ago 2.8GB
<none> <none> 0eb31686926a 5 minutes ago 2.16GB
<none> <none> 69b7aab14d03 5 minutes ago 2.16GB
<none> <none> c08aec3ba4f3 5 minutes ago 2.16GB
<none> <none> eb026f344d64 6 minutes ago 2.16GB
<none> <none> ea4d1f930f54 6 minutes ago 1.92GB
cypress/browsers node14.16.0-chrome89-ff86 94078a0112a3 6 months ago 1.9GB

Docker images saved to cache

Searching for files matching artifact pattern test/**

Finished scanning for test reports. Found 0 test report files.

Merged test suites, total number tests is 0, with 0 failures and 0 errors.
After execution when I go in the caches button, but it seems the cache has not been really saved
Capture d’écran 2021-09-22 à 18.17.47.png
and if a restart a pipeline the Build setup indicate
Cache "docker": Downloading

Cache "docker": Not found

Cache "node": Downloading

Cache "node": Not found
Does anyone have an idea of  my mistake ?
Here my pipeline file
image: atlassian/default-image:2
pipelines:
default:
- step:
name: Build
script:
- docker login XXX
- docker build --tag test-ci .
- docker tag test-ci XXXX
- docker push XXX
services:
- docker
caches:
- docker
- node
artifacts:
- test/**

1 answer

1 accepted

0 votes
Answer accepted

Hi, @Gregory ANNE

Thank you for reaching out to Atlassian Community!

Checking your image, I can see that its size is huge, so this is the reason that cache is not saved. Only caches under 1 GB once compressed are saved. For the cache to compress to under 1 GB, the size of the original images in the Docker must be < 2GB. In this case, I would suggest that you try to reduce the size of your image.

As mentioned in this documentation, under "How does caching work?" section, you can check the size by adding this command to the script in your bitbucket-pipelines.yml:

docker image inspect $(docker image ls -aq) --format {{.Size}} | awk '{totalSizeInBytes += $0} END {print totalSizeInBytes}'

We already have a feature request to improve the message when we upload more than 1 GB as you can see here:

I would suggest that you add your vote there (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. 

You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature request. 

I hope this helps, but do let me know if you have any questions. 

Kind regards,
Caroline

Thanks, we have update the docker image to reduce the size, and all work now.

Like Caroline R likes this
Caroline R Atlassian Team Sep 30, 2021

Hi, Gregory! 

That's great! Thanks for getting back to us, I'm glad to know everything is working now! 

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

123 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you