We are attempting to set up a test environment for some of our authentication code in CircleCI. The actual test isn’t an issue, except in that we believe we are constrained to using machine executors because we need to run multiple docker containers that talk to each other in a particular sequence.
The problem at hand is how to access the cache from inside one of those containers. In our build we are:
- Restoring our (sbt) cache
- Starting a docker container and attaching the cache as a volume
- Executing code inside that container that uses and, in the process, updates that cache.
The update part fails. Our docker container has the user circleci
that is executing the code, which is the user being used in the machine executor. Except these users have different UIDs and the one inside the container does not have the same permission as the one outside the container. The one outside the container owns the volume, and is the only one who can write to it.
Is there a way for the user inside the container to update the cache that is mounted as a volume? We can play around with groups and permissions, but it’s unclear if how circle is using docker will allow any of that to work.