If you follow a ‘normal’ install of docker via the install guide, you add yourself to the docker group to get permissions as a normal user to run the docker commands. If you install on Ubuntu with snap however, you still get error:
permission denied while trying to connect to the docker API at unix:///var/run/docker.sock
Per this post, you need to run this to give yourself permissions:
I just installed and configured a GitLab Runner on a separate Ubuntu 22.04 server. Following tips here and here, I’ve started the runner with ‘sudo gitlab-runner start’ and I’ve verified the config with ‘sudo gitlab-runner verify’, but the GitLab server is still showing the ‘never contacted this instance’ error:
Following the troubleshooting steps here, I used journalctl to view the logs:
Oct 19 14:36:24 proxmox-ubuntu2204-server systemd[1]: Started GitLab Runner. Oct 19 14:36:25 proxmox-ubuntu2204-server gitlab-runner[1264]: FATAL: failed to get user home dir: $HOME is not defined Oct 19 14:36:25 proxmox-ubuntu2204-server systemd[1]: gitlab-runner.service: Main process exited, code=exited, status=1/FAILURE Oct 19 14:36:25 proxmox-ubuntu2204-server systemd[1]: gitlab-runner.service: Failed with result 'exit-code'.
To set a home dir for the gitlab-runner user, I checked /etc/passwd, found the line for gitlab-runner and it has an entry towards the end of the line for /home/gitlab-runner, so that seems ok.
Following tips here, I edited the service config with:
sudo systemctl edit gitlab-runner
which edits /etc/systemd/system/gitlab-runner.service.d/override.conf and added this section:
[Service] Environment="HOME=/home/gitlab-runner"
Restarted the service with:
sudo systemctl restart gitlab-runner
checked the logs again with jornalctl and now we’re up and running, and the runner is reported as available on the Runners page. Done!
Oct 19 14:51:48 proxmox-ubuntu2204-server gitlab-runner[1400]: Runtime platform arch=amd64 os=linux pid=1400 revision=66a723c3 version=17.5.0 Oct 19 14:51:48 proxmox-ubuntu2204-server gitlab-runner[1400]: Starting multi-runner from /etc/gitlab-runner/config.toml... builds=0 max_builds=0 Oct 19 14:51:48 proxmox-ubuntu2204-server gitlab-runner[1400]: Running in system-mode. Oct 19 14:51:48 proxmox-ubuntu2204-server gitlab-runner[1400]: Oct 19 14:51:48 proxmox-ubuntu2204-server gitlab-runner[1400]: Configuration loaded builds=0 max_builds=1
Installing php-fpm on Ubuntu 22:04 prompts for some timezone values during install which makes it more difficult to install during a ‘docker build’ since passing -y to apt-get-install is not enough to respond to the prompts.
Here’s what I’m prompted for if I just run ‘apt-get install php-fpm’:
Configuring tzdata ------------------
Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of cities, representing the time zones in which they are located.
1. Africa 3. Antarctica 5. Arctic 7. Atlantic 9. Indian 11. US 2. America 4. Australia 6. Asia 8. Europe 10. Pacific 12. Etc Geographic area: 8
Please select the city or region corresponding to your time zone.
1. Amsterdam 17. Guernsey 33. Monaco 49. Stockholm 2. Andorra 18. Helsinki 34. Moscow 50. Tallinn 3. Astrakhan 19. Isle_of_Man 35. Nicosia 51. Tirane 4. Athens 20. Istanbul 36. Oslo 52. Tiraspol 5. Belfast 21. Jersey 37. Paris 53. Ulyanovsk 6. Belgrade 22. Kaliningrad 38. Podgorica 54. Uzhgorod 7. Berlin 23. Kirov 39. Prague 55. Vaduz 8. Bratislava 24. Kyiv 40. Riga 56. Vatican 9. Brussels 25. Lisbon 41. Rome 57. Vienna 10. Bucharest 26. Ljubljana 42. Samara 58. Vilnius 11. Budapest 27. London 43. San_Marino 59. Volgograd 12. Busingen 28. Luxembourg 44. Sarajevo 60. Warsaw 13. Chisinau 29. Madrid 45. Saratov 61. Zagreb 14. Copenhagen 30. Malta 46. Simferopol 62. Zaporozhye 15. Dublin 31. Mariehamn 47. Skopje 63. Zurich 16. Gibraltar 32. Minsk 48. Sofia Time zone: 27
Current default time zone: 'Europe/London' Local time is now: Tue Sep 24 16:39:08 BST 2024. Universal Time is now: Tue Sep 24 15:39:08 UTC 2024. Run 'dpkg-reconfigure tzdata' if you wish to change it.
From answers on this post, the easiest option (rather than setting values for the prompted values) is to run in non-interactive mode, and just default the tz to UTC, with: