Score:0

Using a RHEL system in a Jenkins pipeline, issues with permissions in docker-compose volumes

fr flag

I have an RHEL 7 Jenkins agent. On this agent, I have configured a pipeline to simply pull some code and do a

sh 'docker-compose up'

with the following compose file.

version: '3'
services:
  pythontest:
    image: python:3.6
    volumes:
      - ./logs:/usr/local/logs

The issue comes in the post step, where I want to do a cleanup and delete all the folders and files in the workspace. It seems that the files that were created by the volume are owned by root and only root and write to them. So Jenkins can't delete them. The post step is a simple call to cleanWS

cleanWs deleteDirs: true

How can I let the Jenkins user be the owner of the files so they can be cleaned up?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.