Open charlyschulte opened 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.
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:
uses: stonemaster/hetzner-github-runner@HEAD with: github-api-key: ${{ secrets.GH_API_KEY }} hetzner-api-key: ${{ secrets.HETZNER_API_KEY }} hetzner-instance-type: cx22 hetzner-location: fsn1 build-with-commit-tag: runs-on: self-hosted needs: prepare_env steps:
name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=echo ${GITHUB_SHA} | cut -c1-8
" >> $GITHUB_ENV
uses: actions/checkout@v2.5.0
name: Create .env file run: | touch .env.local echo "SECRETS=#######" >> .env.local
name: Set up Docker Buildx uses: docker/setup-buildx-action@v3
name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.TOKEN }}
name: Build and push Docker image uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile platforms: linux/arm64 push: true tags: ####### cache-from: type=gha cache-to: type=gha,mode=max
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
@stonemaster do you have any idea why it is not working? greetings Charly
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?