question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setup-buildx-action messes up already installed buildx on self-hosted runner.

See original GitHub issue

Steps to reproduce this issue

Install self hosted actions runner as directed here https://stackoverflow.com/questions/66137419/how-to-enable-non-docker-actions-to-access-docker-created-files-on-my-self-hoste & enable experimental features to enable buildx
Run a github action that sets up buildx, then uses the login action, and then the buildx action
observe the error

Expected behaviour

It builds correctly Actual behaviour

I get an error

on:
  push:
    branches:
      - '**'
name: UH Schedule CI

defaults:
  run:
    working-directory: 'uh/schedule'

jobs:
  test:
    name: Test
    runs-on: [self-hosted, linux, x64]
    container: node:14-slim
    steps:
      - uses: actions/checkout@v2
      - run: yarn install --frozen-lockfile --non-interactive
      - run: yarn build
        working-directory: sdk
      - run: yarn test
  test_with_redis:
    services:
      redis:
        image: redis:6-alpine
        ports:
          - 6379:6379
    name: Test with Redis
    runs-on: [self-hosted, linux, x64]
    container: node:14-slim
    env:
      REDIS_URL: redis://redis:6379
    steps:
      - uses: actions/checkout@v2
      - run: yarn install --frozen-lockfile --non-interactive
      - run: yarn build
        working-directory: sdk
      - run: yarn test
  lint:
    name: Lint
    runs-on: [self-hosted, linux, x64]
    container: node:14-slim
    steps:
      - uses: actions/checkout@v2
      - run: yarn install --frozen-lockfile --non-interactive
      - run: yarn build
        working-directory: sdk
      - run: yarn lint
  build_push_beta:
    name: Build and Push beta
    runs-on: [self-hosted, linux, x64]
    steps:
      - uses: actions/checkout@v2
      - uses: docker/setup-buildx-action@v1
      - uses: docker/login-action@v1
        with:
          registry: xxx
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      - name: Build and push Docker images
        uses: docker/build-push-action@v2
        with:
          context: .
          tags: xxx/xx:${{ github.sha }}
          push: true
          build-args: |
            workspace=uh/schedule
  build_push_prod:
    name: Build and Push prod
    needs:
      - test
      - test_with_redis
      - lint
    runs-on: [self-hosted, linux, x64]
    if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, 'v*' )
    steps:
      - uses: actions/checkout@v2
      - uses: actions/github-script@v3
        with:
          id: tag
          script: |
            return context.payload.ref.replace(/\/refs\/tags\//, '');
          result-encoding: string
      - uses: docker/setup-buildx-action@v1
      - uses: docker/login-action@v1
        with:
          registry: xxx
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      - name: Build and push Docker images
        uses: docker/build-push-action@v2
        with:
          tags: xxx/xx:${{ steps.tag.outputs.result }}
          push: true
          build-args: |
            workspace=uh/schedule

Removing the docker setup-buildx-action makes everything work as expected.

Related issue: https://github.com/docker/build-push-action/issues/292

Is there a way to make the setup buildx action basically do nothing when buildx is already installed and setup?

Edit: adding driver: docker fixes this

      - uses: docker/setup-buildx-action@v1
        with:
          driver: docker

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
crazy-maxcommented, Jun 11, 2021

Ok thanks for your feedback, closing this issue as it’s a dup of docker/build-push-action#292 you have opened previously. Will catch up there.

0reactions
Frederik-Baetenscommented, Jun 11, 2021

From the same run:

Run docker/setup-buildx-action@v1
  with:
    driver: docker-container
    buildkitd-flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
    install: false
    use: true
Docker info
  /usr/bin/docker version
  Client: Docker Engine - Community
   Version:           20.10.5
   API version:       1.41
   Go version:        go1.13.15
   Git commit:        55c4c88
   Built:             Tue Mar  2 20:17:52 2021
   OS/Arch:           linux/amd64
   Context:           rootless
   Experimental:      true
  
  Server: Docker Engine - Community
   Engine:
    Version:          20.10.5
    API version:      1.41 (minimum version 1.12)
    Go version:       go1.13.15
    Git commit:       363e9a8
    Built:            Tue Mar  2 20:15:47 2021
    OS/Arch:          linux/amd64
    Experimental:     false
   containerd:
    Version:          1.4.4
    GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
   runc:
    Version:          1.0.0-rc93
    GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
   docker-init:
    Version:          0.19.0
    GitCommit:        de40ad0
  /usr/bin/docker info
  Client:
   Context:    rootless
   Debug Mode: false
   Plugins:
    app: Docker App (Docker Inc., v0.9.1-beta3)
    buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  
  Server:
   Containers: 1
    Running: 0
    Paused: 0
    Stopped: 1
   Images: 17
   Server Version: 20.10.5
   Storage Driver: overlay2
    Backing Filesystem: extfs
    Supports d_type: true
    Native Overlay Diff: false
   Logging Driver: json-file
   Cgroup Driver: systemd
   Cgroup Version: 2
   Plugins:
    Volume: local
    Network: bridge host ipvlan macvlan null overlay
    Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
   Swarm: inactive
   Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
   Default Runtime: runc
   Init Binary: docker-init
   containerd version: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
   runc version: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
   init version: de40ad0
   Security Options:
    seccomp
     Profile: default
    rootless
    cgroupns
   Kernel Version: 5.8.0-48-generic
   Operating System: Ubuntu 20.10
   OSType: linux
   Architecture: x86_64
   CPUs: 4
   Total Memory: 3.265GiB
   Name: ubuntu-groovy-server3
   ID: FEVD:JCDM:7ZB4:2H3Y:QQN5:IRA5:T4MB:ZXR4:QS2Z:26BR:DVED:UPSW
   Docker Root Dir: /home/frederik/.local/share/docker
   Debug Mode: false
   Username: ***
   Registry: https://index.docker.io/v1/
   Labels:
   Experimental: false
   Insecure Registries:
    127.0.0.0/8
   Live Restore Enabled: false
  
  WARNING: No cpu cfs quota support
  WARNING: No cpu cfs period support
  WARNING: No cpu shares support
  WARNING: No cpuset support
  WARNING: Support for cgroup v2 is experimental
  WARNING: No io.weight support
  WARNING: No io.weight (per device) support
  WARNING: No io.max (rbps) support
  WARNING: No io.max (wbps) support
  WARNING: No io.max (riops) support
  WARNING: No io.max (wiops) support
Using buildx 0.5.1
Creating a new builder instance
  /usr/bin/docker buildx create --name builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b --driver docker-container --buildkitd-flags --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host --use
  builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b
Booting builder
  /usr/bin/docker buildx inspect --bootstrap --builder builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b
  #1 [internal] booting buildkit
  #1 sha256:66369ae49bdb3682116e1529281ac708593295dfb7c87af09b266759dcf5e6e1
  #1 pulling image moby/buildkit:buildx-stable-1
  #1 pulling image moby/buildkit:buildx-stable-1 16.3s done
  #1 creating container buildx_buildkit_builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b0
  #1 creating container buildx_buildkit_builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b0 5.1s done
  #1 ERROR: Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:495: container init caused: write sysctl key net.ipv4.ping_group_range: write /proc/sys/net/ipv4/ping_group_range: invalid argument: unknown
  ------
   > [internal] booting buildkit:
  ------
  Name:   builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b
  Driver: docker-container
  
  Nodes:
  Name:     builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b0
  Endpoint: rootless
  Error:    Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:495: container init caused: write sysctl key net.ipv4.ping_group_range: write /proc/sys/net/ipv4/ping_group_range: invalid argument: unknown
Inspect builder
  {
    "name": "builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b",
    "driver": "docker-container",
    "node_name": "builder-70f5ef81-494f-4276-8f07-b74ff9d8ae5b0",
    "node_endpoint": "rootless",
    "node_status": "stopped",
    "node_flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host"
  }
BuildKit version
  moby/buildkit:buildx-stable-1 => buildkitd github.com/moby/buildkit v0.8.3 81c2cbd8a418918d62b71e347a00034189eea455
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to enable non-docker actions to access ... - Stack Overflow
A better solution is using rootless docker: Remove docker from your system if you have previously installed it through Ubuntu's default ...
Read more >
Configuring your builder - Docker Documentation
Configuring your builder. This page contains instructions on configuring your BuildKit instances when using our Setup Buildx Action.
Read more >
Developer news about Docker - Changelog
Docker is a platform built for developers to build and run applications. ... Dashy is a self-hosted dashboard for your homelab.
Read more >
Troubleshooting Omnibus GitLab installation issues
On SELinux-enabled systems the Git user's .ssh directory or its contents can get their security context messed up. You can fix this by...
Read more >
armv7 docker image created with QEMU action causes Illegal ...
I build my docker images on Github, for three architectures at once. ... QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found