linuxserver / docker-jenkins-builder

Repo used to develop build logic for templating pipeline repositories
GNU General Public License v3.0
19 stars 21 forks source link

Running locally against docker-deluge project fails #122

Closed magikid closed 3 years ago

magikid commented 3 years ago

linuxserver.io


Expected Behavior

I expected all of the templates to be regenerated.

Current Behavior

An error is thrown by Ansible:

TASK [roles/generate-jenkins : create destination dir for generated github files] ***
fatal: [localhost]: FAILED! => {"changed": false, "gid": 65534, "group": "nobody", "mode": "0755", "msg": "chown failed: [Errno 1] Operation not permitted: b'/tmp/.github'", "owner": "root", "path": "/tmp/.github", "size": 4096, "state": "directory", "uid": 0}

Steps to Reproduce

  1. Clone docker-deluge project
  2. Setup userns-remap as explained in the Docker documentation
  3. Run the docker-jenkins-builder locally

Environment

OS: Pop!_OS 21.04 (Ubuntu derivative) CPU architecture: x86_64 How docker service was installed: Through the Docker repo

Command used to create docker container (run/create/compose/screenshot)

😎  λ ~/personal-projects/docker-deluge/ master docker pull ghcr.io/linuxserver/jenkins-builder:latest && \                     
docker run --rm \                                                                                                               
  -v $(pwd):/tmp \                                                                                                              
  -e LOCAL=true \                                                                                                               
  -e PUID=$(id -u) -e PGID=$(id -g) \
  ghcr.io/linuxserver/jenkins-builder:latest && \
rm -rf .jenkins-external

Docker logs

docker run --rm \                                                                                                               
  -v $(pwd):/tmp \                                                                                                              
  -e LOCAL=true \                                                                                                               
  -e PUID=$(id -u) -e PGID=$(id -g) \
  ghcr.io/linuxserver/jenkins-builder:latest && \
rm -rf .jenkins-external
latest: Pulling from linuxserver/jenkins-builder
Digest: sha256:351cafa28b4dee87f63a4258e5eee35f8cdd68e6bf2304301bbfaadb48145b8a
Status: Image is up to date for ghcr.io/linuxserver/jenkins-builder:latest
ghcr.io/linuxserver/jenkins-builder:latest
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [set_fact] ****************************************************************
ok: [localhost]

TASK [set_fact] ****************************************************************
ok: [localhost]

TASK [roles/generate-jenkins : set UID] ****************************************
changed: [localhost]

TASK [roles/generate-jenkins : set UID] ****************************************
changed: [localhost]

TASK [roles/generate-jenkins : download variables] *****************************
skipping: [localhost] => (item=jenkins-vars.yml) 
skipping: [localhost] => (item=readme-vars.yml) 

TASK [roles/generate-jenkins : include var files for this project] *************
ok: [localhost] => (item=jenkins-vars.yml)
ok: [localhost] => (item=readme-vars.yml)

TASK [roles/generate-jenkins : include template loop variables] ****************
ok: [localhost]

TASK [roles/generate-jenkins : create destination dir for generated Jenkinsfile] ***
skipping: [localhost]

TASK [roles/generate-jenkins : create destination dir for generated github files] ***
fatal: [localhost]: FAILED! => {"changed": false, "gid": 65534, "group": "nobody", "mode": "0755", "msg": "chown failed: [Errno 1] Operation not permitted: b'/tmp/.github'", "owner": "root", "path": "/tmp/.github", "size": 4096, "state": "directory", "uid": 0}

PLAY RECAP *********************************************************************
localhost                  : ok=7    changed=2    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0   

🔥  λ ~/personal-projects/docker-deluge/ master 
github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

aptalca commented 3 years ago

chown failed: [Errno 1] Operation not permitted userns-remap is your issue

magikid commented 3 years ago

Yeah, it sure is. Disabling it and restarting the Docker daemon lets this image run. I'm not exactly sure why but I believe the issue is with this particular container since I've never run into this issue before running this container.

aptalca commented 3 years ago

Our images require root for the container during init. The processes inside (most of them) run as unprivileged users set via PUID/PGID.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

thelamer commented 3 years ago

Closing as this is expected behavior, we use S6 init running as root.

github-actions[bot] commented 1 year ago

This issue is locked due to inactivity