So I am playing around with containers for educational purposes, and installed Docker on a remote Linux server running Debian. My hope was to run a Gitea instance out of it. That didn’t work out the first time around, so I uninstalled Docker.
Now, I currently have a setup of Gitea (actually Forgejo) plus a Gitea actions runner (CI/CD similar to Github Actions), both of which self-hosted on the same machine. They are both working for the most part, however sometimes when I run an action, I get the following error:
failed to query docker info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
For context, I have actually installed and hosted a Gitea+runner setup on this same Linux box previously, before installing Docker. And I believe I remember running some of these same actions then, and back then they did work. So this makes me think that I haven’t perfectly uninstalled Docker, and there is something about my system which triggers some of these actions to believe that there is a Docker daemon that might be running.
Here is a link to the action which I am having problems with. Here is a link to another action which I am having problems with (but I no longer use). Both of these actions I am pretty sure I ran in my previous installation of Gitea and had success with. But now I get the same above error when running both.
For uninstalling Docker, I have done the following:
Ran the apt purge and apt auto-remove commands, per documentation.
I additionally ran iptables -L and didn’t see anything Docker-related. I have already rebooted the system.
Has anyone else encountered a similar issue, or think they know what might be causing this? I know this is a pretty specific setup, but I figured I start by posting here and work my way from there.
Just out of curiosity: don’t the actions use container images as base? How are those supposed to be run?
Apart from Docker and Podman, Forgejo runners can also use LXC containers and the host (see: docs), but if you use the host runner it can only run local steps (as in list of commands), but no actions. Why would anyone want to use the host runner, as it does not provide the biggest advantage container based runners provide: untainted build and execution environments.
I can only recommend to pick up the container trail, and this time-share the error logs you get when “it is not working”.
Forgejo runners are supposed to be runnable directly on the host (docs), and that’s what I’d like to try and do for this go-around. If it’s the case that certain actions strictly require Docker, then I can accept that. It’s just I could have sworn this was not the case in the past, and am wondering if something changed on my system. I might attempt to try on another system that I haven’t installed Docker on later.
I would like to explore Docker/Podman/LXC. I tried to run Gitea out of Docker, and faced a random issue which was that every time I logged into my instance, I would get no error message and simply not remained logged in, and couldn’t find anyone else with similar issues online, so I gave up. Later on I tried to run Forgejo runners in LXC containers, however the LXC helper scripts Forgejo provides simply did not work out of the box for me, and simple googling did not help, so I gave up again. I did not put much effort into figuring out Docker/LXC and was quick to give up I mostly just wanted to get a working CI/CD pipeline running. I’m not doing anything crazy with my workflows so I’m not too worried about the lack of containerization for now. I’m planning to go back and attempt to learn LXC or Podman to help harden all of this.
Nothing to argue about, I listed it in my response as well
You can still have configuration settings or things in your pipeline that act as a docker client trying to communicate with a local docker engine. At least that’s what the error message indicates. Actions are a strong candidate for this, as they usually use their own container image.
But it’s not the point I was making: my point is that actions will require containers, and that not using a disposable (=containerized) runner will result in a tainted environment - while the first one would be a huge loss of comfort, the second one is a huge antipattern for CI/CD.
Just because it’s the cleaner and better way, doesn’t mean you will have to use it. I just wanted to make you aware. Feel free to ignore it
Thank you for your input, I agree with everything you’ve said but I’m not asking for advice on patterns, my question is specifically about this error message:
failed to query docker info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I mostly want to confirm if this is indicative that the action I’m attempting to use does in fact necessitate Docker/Podman/LXC, and is incompatible with self-hosted runners. It feels weird that other actions would work without Docker, but these ones don’t (I have several pipelines currently working). My thought was that I might have something mounted somewhere, or a .sock file somewhere that is triggering the action to query my system for a Docker daemon.
You can still have configuration settings or things in your pipeline that act as a docker client trying to communicate with a local docker engine.
I have checked the Forgejo docs and can’t find anything that would be causing this. I have set up my runner config specifically to not require Docker.
This isn’t a huge issue that is blocking me or anything, it’s just a “I don’t understand this and that makes me uncomfortable” type of situation. And if this is beyond the scope of the Docker forums, no worries, I can ask around elsewhere.