stonemaster / hetzner-github-runner

Automatically deploy self-hosted GitHub runner in the Hetzner Cloud
6 stars 2 forks source link

Cant get docker build to run #1

Open charlyschulte opened 1 week ago

charlyschulte commented 1 week ago

Hello, first of all thanks for your great work. i would really like to use the script and build my container on the hetzner cloud. i have now tried for many hours get it working, the problem is, that i get ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? every time i try to use docker build in my workflow. do you have any idea to get the build command to work? or is it simply not possible to build a container within the container?

stonemaster commented 1 week ago

Thank you for your issue report!

One thing I see here is that the current setup starts a Docker container that is deployed on a Hetzner instance. That also means that running docker build will try to talk to the Docker daemon, but of course it won't be accessible as it is already running inside a container. And exposing the Docker socket is a bad idea AFAIK :thinking:

Do you have a stripped down version of your Github CI YAML? The underlying Github container I am using is built using docker/setup-buildx-action which theoretically should also make this use case work. See here for an example.

charlyschulte commented 1 week ago

Thanks for the quick response. here is my ci yaml: name: Build and Publish

on: push: branches:

jobs: prepare_env: runs-on: ubuntu-latest name: Create new Hetzner Cloud instance for build steps:

when i run the docker/setup-buildx-action i also get an "Cannot connect to the Docker daemon" error. maybe you have an idea thanks again Charly

charlyschulte commented 1 hour ago

@stonemaster do you have any idea why it is not working? greetings Charly