Is a pipe running in a Docker image without root user supported?

Julien HENRY October 8, 2024

Hi,

 

We tried to change our pipe to use a base Docker image where the user is a regular user, not root.

As a result, the pipeline failed when trying to write to $BITBUCKET_PIPE_STORAGE_DIR:

tee: /opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-scan/sonarcloud-scan.log: Permission denied

So we had to revert to root.

Is this even possible to run a pipe with a non-root user? Or is it part of Bitbucket Pipes guidelines that Docker images should be run as root?

I am fine with the second option, but would it be possible to explicitly document it, as GitHub does for GitHub Actionsto stop users from challenging us for not following Docker best practices?

 

FYI I added some debug logs to my pipe, and here is the result of ls -ad $BITBUCKET_PIPE_STORAGE_DIR:

drwxr-xr-x 2 root root 4096 Oct 3 14:09 /opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-scan

You can see that only root can write in this folder.

1 answer

1 vote
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2024

Hi @Julien HENRY . Thanks for your question.

We will discuss this with Bitbucket Pipelines team  and notify you.

Regards, Igor

Suggest an answer

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

Atlassian Community Events