Docker Community Forums

Share and learn in the Docker community.

Set owner and permissions for cloudstor volumes


(Ptaylor) #1

Is it possible to set the uid, gid and mode for cloudstor volumes at volume creation time? I made a compose file to run the public jenkins image which uses uid 1000 but it fails to start because it can’t write to the root owned volume that cloudstor creates.

I’m able to work around this by manually creating the volume, running a container to set the permissions, then running jenkins, but I’m trying to make the setup simple and repeatable by using a compose file and deploying as a stack.

I noticed that cloudstor for azure has volume options to set these, and the documentation specifically mentions the jenkins use case, but the options don’t seem to work for AWS.

Any ideas? Maybe I’m overlooking something? Thanks!

jenkins compose file
version: '3.4'

services:
  master:
    image: jenkins/jenkins:lts
    volumes:
      - home:/var/jenkins_home

volumes:
  home:
    name: '{{.Service.Name}}-{{.Task.Slot}}'
    driver: cloudstor:aws
    driver_opts:
      backing: relocatable
      size: 25
      ebstype: gp2