Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action uselessly requires a running Docker daemon with the Kubernetes buildx driver #593

Closed
antoinedeschenes opened this issue Apr 11, 2022 · 0 comments · Fixed by #601
Closed
Labels
kind/enhancement New feature or request

Comments

@antoinedeschenes
Copy link

Troubleshooting

Same as buildx action issue docker/setup-buildx-action#135

Behaviour

Steps to reproduce this issue

  1. Setup a self-hoster runner without any docker daemon.
  2. Setup a docker buildx runner using the kubernetes driver:
    $ docker buildx create --append --driver=kubernetes --platform linux/amd64 --driver-opt 'namespace=mynamespace,requests.cpu=1,requests.memory=1Gi,limits.cpu=1,limits.memory=2Gi,nodeselector=kubernetes.io/arch=amd64,rootless=true'

Expected behaviour

build-push-action should build a docker image using the kubernetes driver.

Actual behaviour

Action fails during the Docker info step, as it calls docker version and docker info, both of which expect a running Docker daemon.
https://github.com/docker/setup-buildx-action/blob/20111c644724909db5e5afbf25d7de40ddf74f0b/src/main.ts#L13-L16

Configuration

jobs:
  build-push:
    runs-on: self-hosted
    steps:
      - id: build_info
        name: build info
        run: echo ::set-output name=tags::ghcr.io/${{ github.repository }}:latest
      - name: setup buildx
        run: |
          docker buildx create --append --driver=kubernetes --platform linux/amd64 --driver-opt 'namespace=mynamespace,requests.cpu=1,requests.memory=1Gi,limits.cpu=1,limits.memory=2Gi,nodeselector=kubernetes.io/arch=amd64,rootless=true'
      - name: build and push
        uses: docker/build-push-action@v2
        with:
          tags: ${{ steps.build_info.outputs.tags }}
          platforms: linux/amd64
          push: false

Logs

Example of Docker info step:

$ docker version
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Client:
 Cloud integration: v1.0.22
 Version:           20.10.13
 API version:       1.41
 Go version:        go1.16.15
 Git commit:        a224086
 Built:             Thu Mar 10 14:08:43 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
@crazy-max crazy-max added the kind/enhancement New feature or request label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants