File permission mount issues

I am having an understanding issues with volume mounts, and specific containers.
In this case, I am setting op a bitbucket container (https://hub.docker.com/r/atlassian/bitbucket-server/)

When I run this container (like so):
docker run --network mynet --name bitbucket -e JDBC_DRIVER=org.postgresql.Driver -e JDBC_USER=bitbucket -e JDBC_PASSWORD=bitbucket -e JDBC_URL=jdbc:postgresql://postgres:5432/bitbucket -p 7990:7990 -p 7999:7999 -v /data/bitbucket:/var/atlassian/application-data/bitbucket/shared:z -i -t --rm atlassian/bitbucket-server

I am presented with file permission errors because /data/bitbucket isn’t writable by the user in the container. After some digging, I found the user in the container is ID 2003.

I understand why this occurs, but when I read the dockerhub page, there is no reference to taking extra steps to secure the bitbucket local volume, which they totally recommend.

Is there something else going on that I don’t understand, or are some things taken for granted?

Seems more like you missed that detail.

In the Dockerfile a user is added in a RUN statement. So far so good.
The bad news is, that they didn’t switch to that user using a USER statetment. If they would have done that, modifying the UID:GID in the container would be as simple as adding -u uid:gid to docker run. Pitty that this is not an option. So either change the owner of the folder or build your own image with the UID:GID that you need.

I completely missed it. Thanks for point it out! That’s answers the questions concretely.