Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring the "Build teardown"

Beniamin Kowol
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 3, 2024

Hi there!
I have a BB Pipeline that runs okay, but I want to cache some files from the build.
I've added docker caches and services to yml file.
When I check the logs of Build teardown it shows:

The docker cache will consist of all unique layers from the following images:
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
"docker image save" requires at least 1 argument.
See 'docker image save --help'.

Usage: docker image save [OPTIONS] IMAGE [IMAGE...]

Save one or more images to a tar archive (streamed to STDOUT by default)
chmod: cannot access '/opt/atlassian/pipelines/agent/cache/docker/docker.tar': No such file or directory
Docker images saved to cache
Cache "docker: docker.tar": Skipping upload for empty cache

So I think something is wrong…
Am I able to configure commands executed on teardown? Or should I add some configuration to fix above errors?

2 answers

1 vote
Jim Knepley - ReleaseTEAM
Atlassian Partner
October 3, 2024

The error message suggests you've got a filesystem permissions problem:

chmod: cannot access '/opt/atlassian/pipelines/agent/cache/docker/docker.tar': No such file or directory

 

The user tearing down the build container almost certainly doesn't have access to one of the directories along that path. If you can fix the file permissions on the system, or add the user to a group that has permission, it should work.

Beniamin Kowol
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 3, 2024

Can I control the teardown process from BB pipeline?

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 7, 2024

Hi Beniamin and welcome to the community!

The "Build teardown" is not configurable.

The error indicates that there is no docker.tar file for the cache to save. Are you building a Docker image during this step? The Docker cache is meant to cache layers from a Docker image you build during the step. If you are not building any Docker image, there will be no cache to save.

Are you perhaps trying to cache different dependencies? If so, you can check our documentation below:

You can see in this documentation that Pipelines provides pre-defined cache locations for commonly used language tools and also that it is possible to define a custom cache.

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events