I want to run my containers with different users. I’ve read this should be possible with the
user tag but it does’t seem to work. This is the part of my docker-compose.yaml. The user “jenkins” does exist on the host machine with the uid/gid 1008 but all files created in the volumes are owned by root. That causes the container to fail during startup.
Am I missing something here?
jenkins: image: jenkins/jenkins container_name: jenkins restart: always ports: - "8090:8080" environment: - JENKINS_OPTS="--prefix=/jenkins" volumes: - /home/jenkins/jenkins_home:/var/jenkins_home - /home/jenkins/bin/docker:/usr/bin/docker - /home/jenkins/var/run/docker.sock:/var/run/docker.sock networks: - toolchain user: 1008:1008
Thanks in advance.