uuid the surrounding CI server thinks they belong to root. For subsequent npm scripts the errors were of the class:
npm ERR! Error: EACCES: permission denied
We needed to find a solution to this problem. In previous versions of Docker, our team had to create delegation scripts. These scripts took your command as a string, changed users and ran it. We needed our commands to execute as a user who could access any created files from the lifetime of the command. These workarounds required base images that held the scripts. This narrowed the images we could pull from Docker hub, and complicated the use when we did. Thanks to newer versions of Docker we can remove the scripts and use any Docker Hub image. By throwing the
— user argument to
docker run, we are able to enforce that the command runs under the
uuid we passed in. Your needs may vary, so Docker has provided flexibility in the run command. For more info check out the Docker run — user docs.
Since we use the newest version of bamboo, we can take advantage of Bamboo Specs. Here is a Java snippet for how we make Docker containers run on bamboo.
While you are down here: All opinions are my own, and do not necessarily reflect those of my employer.