I’ve been trying to figure this part out for a few days. I have my own Forgejo instance and a website each running in separate containers on a Raspberry Pi. I also have the forgejo runner installed in another docker container. I followed some guides to set up forgejo actions, but all the guides end with a simple example that basically just runs the “ls” command.

I tried running ‘docker compose up’ inside my workflow, but it fails with “docker: command not found”. So how do you use the workflow to actually update the website in the other container?

I think I’d prefer keeping everything in docker but I’d be okay with making the workflow run some script on the host machine if needed.

  • DionNam@programming.dev
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 day ago

    The error is because the runner container has no docker client and no access to the host’s daemon. The usual fix is to mount /var/run/docker.sock into the runner and use a job image that ships the docker CLI, then docker compose up -d works from the workflow. Keep in mind that socket is basically root on the Pi, so only run workflows you trust.