We're trying to using a custom build image for our Bitbucket pipeline, but there is some information about how the agent is started that is obscured. I'm curious about what commands are executed in order to start the agent, and then what commands are executed during the "Build setup" phase.
This would be helpful in making sure our build agent does what we want. For instance, we've setup our build agent to end in a certain WORKDIR, but that seems to be irrelevant to Pipelines since it looks like it sets its own WORKDIR. Even if we try to set things up in the '/opt/atlassian/pipelines/agent/build' directory which it seems to force, everything in there seems to get wiped by the time we get to our build steps.
I'm just looking for some total transparency in what's happening. We can at least see the commands that run during "Build setup" but simply preparing for those commands doesn't help. I assume it starts the build agent in slightly different ways (for instance docker:true gives the image access to dockerd and docker commands without installing docker on the image itself) based on the pipeline script.
It would probably be useful to know what happens during the "Build teardown" phase as well but that's less critical.