You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my hooks, I've had to use git (among other tools) as a specific user (whose uid is 999).
Since git was not provided by the carlos-jenkins/python-github-webhooks docker image (and I did not want to hack into it) I derived a customized image based on yours, with this Dockerfile.extended:
FROM carlos-jenkins/python-github-webhooks
MAINTAINER"François Van Der Biest" <[email protected]>
# add packages required to run your hooks, eg:RUN apk update && apk add bash git openssh-client
# create user which will run hooks (group ping has gid=999 in base image)RUN adduser -S -G ping -s /bin/bash -u 999 sftp
# required here to populate root's known_hosts so that git pull command # does not interactively ask to check RSA key fingerprint:RUN mkdir -p /root/.ssh && \
chmod 700 /root/.ssh && \
ssh-keyscan github.com >> /root/.ssh/known_hosts
In my hooks, I've had to use git (among other tools) as a specific user (whose uid is 999).
Since git was not provided by the
carlos-jenkins/python-github-webhooks
docker image (and I did not want to hack into it) I derived a customized image based on yours, with thisDockerfile.extended
:then:
docker build -t fvanderbiest/python-github-webhooks -f Dockerfile.extended .
Finally, I set the setuid bit on my hook, and gave it to user with uid 999:
chmod u+s push-myrepo-mybranch
It works great !
This is not really an issue, but I thought it might be useful to others...
The text was updated successfully, but these errors were encountered: