Jump to content

Docker deployment from CI/CD pipeline


werscajk

Recommended Posts

I had quite a hard time figuring out how to persistently create user only for docker without giving root access to Gitlab in CI/CD pipeline. If you do normal unix suff with adduser, passwd and so on you will loose all of that after reboot. In the end it was quite easy. So I'm going to share with you all to save you three days I spent with this stupidly trivial task. You just need to do this:

  1. Create new user with password via Web Managment of UnRAID in USERS tab. Let's call this new user deployer.
  2. Change deployers default group with: usermod -g docker deployer
  3. Edit /etc/passwd manually (not recomended, but this is small change)
    1. Find line with deployer
    2. Change from /bin/false to /bin/bash to allow ssh access for deployer
    3. Save
  4. copy /etc/passwd to /boot/passwd with: cp /etc/passwd /boot/passwd

 

DONE! That's IT! It just works. Now you have persistent user that you can add to Gitlab (or Github or whatever else) and automatically deploy your things from CI/CD pipeline straight to Docker on your UnRAID machine.

Edited by werscajk
  • Thanks 3
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...