vegardit / docker-gitea-act-runner

Docker image based on debian:stable-slim to run Gitea's act_runner as a Docker container

Home Page:https://buymeacoffee.com/vegardit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker not found error when trying to run ci command with docker

aminify opened this issue · comments

Hi there
I'm very new to ci/cd and setting up services. But I managed to run gitea alongside this runner successfully. In my actions I want to do a docker build after checkout but I get the error that docker is not found. I think this is really silly. Should I somehow manually install docker in the runner?

good catch, yes the docker client was missing. I added it to the docker image, please give it a try.

I'm also having this issue, I tried the updated container, but still getting the error. Should I clean the volume and start the runner fresh?

I missed to add the binary to the final image. should work now. thanks for the feedback.

Thank you! I don´t know if it is related, but the newer version is not finding node in PATH.

I don't think that is related. Node should not be required in the container that executes the act_runner. act_runner basically just spawns other docker containers.

True, On the docker side, still no luck. It is giving the docker not found error.

Edit: If i ssh into the container, docker is there and working correctly, but if I try to run a docker build command on a step, it returns not found

The problem is, the node16 container that the runner spawns has no docker CLI, even though the volumemap to the docker.sock is there.

ok, so the act-runner container doesn't need the docker client after all.

The problem is, the node16 container that the runner spawns has no docker CLI, even though the volumemap to the docker.sock is there.

the volume map alone is not sufficient. the container also needs to have the docker client binary if it tries to invoke the docker command

ok, so the act-runner container doesn't need the docker client after all.

I'm not sure, because the runner needs to spawn the children containers.

The problem is, the node16 container that the runner spawns has no docker CLI, even though the volumemap to the docker.sock is there.

the volume map alone is not sufficient. the container also needs to have the docker client binary if it tries to invoke the docker command

Exactly, the problem is that right now the act runner only spawns node:16 children, I don't know if this is an upstream bug frlm gitea, or if I'm doing something wrong on my configurations.

Thanks for your quick response and fix @sebthom.
Unfortunately I still get the same error when my action is running (/var/run/act/workflow/1: line 2: docker: command not found)
But when I attached to the runner terminal, docker exists there. So could you please elaborate what should be done here?

Apparently this was an issue from the runner image and that didn't have docker installed. I managed to fix this issue using ubuntu-latest:docker://catthehacker/ubuntu:act-22.04 asGITEA_RUNNER_LABELS env variable when running the docker container.

Apparently this was an issue from the runner image and that didn't have docker installed. I managed to fix this issue using ubuntu-latest:docker://catthehacker/ubuntu:act-22.04 asGITEA_RUNNER_LABELS env variable when running the docker container.

This is it! @sebthom, if not specified, maybe the docker image should use these labels as default:

  • ubuntu-20.04:docker://node:16-bullseye
  • ubuntu-18.04:docker://node:16-buster
  • ubuntu-latest:docker://catthehacker/ubuntu:act-22.04

Otherwise the runners will be created only using node:16, and with no docker support.

There are other image examples that can by found on here.

Thanks for your help @aminify!

PS.: I'm still not sure if the docker client is needed or not, if you need someone to help you test it, ping me @sebthom

@joaolongo that sounds like a good idea. I am a.f.k. at the moment but will get back to this next week.

I reverted the inclusion of the docker client in the runner docker image as it has no effect and changed the default labels to use catthehacker/ubuntu:runner-** docker images.

Closing the issue for now. Feel free to reopen if required.