actions / runner-images

GitHub Actions runner images
MIT License
10.05k stars 3.03k forks source link

cat: /etc/docker/daemon.json: No such file or directory #10697

Open hansehe opened 2 weeks ago

hansehe commented 2 weeks ago

Description

Hi,

I'm using the docker github actions package to install docker for building container images:

But just yesterday, I continuously get this error in the github actions pipeline:

Run docker-practice/actions-setup-docker@master
check docker systemd status
check docker version
add apt source
update apt cache
show available docker version
remove default moby
install docker
check docker version
check docker systemd status
show default daemon json content
  /usr/bin/sudo cat /etc/docker/daemon.json
  cat: /etc/docker/daemon.json: No such file or directory
  Error: Error: The process '/usr/bin/sudo' failed with exit code 1

The job runs on ubuntu-latest (, with this setup:

name: CD

on: 
  workflow_dispatch: {}
  push:
    tags: [ 'v*' ]

env:
  DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
  DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        docker_channel:
          - stable

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
      - name: setup Docker
        uses: docker-practice/actions-setup-docker@master
        with:
          docker_channel: ${{ matrix.docker_channel }}
      - name: login to docker hub
        uses: docker/login-action@v1
        with:
          registry: docker.io
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Install requirements
        run: |
          pip install DockerBuildManagement

      - name: Publish
        run: |
          dbm -build -publish prod

I think it's a problem with some runners hosted by github since I tried the same job in another organization on github where it works.

After some digging, I then downgraded to ubuntu-22.04, and then it all works. So is there something wrong with ubuntu-24.04 and docker compatibility?

Best regards. Hans Erik Heggem

Platforms affected

Runner images affected

Image version and build link

ubuntu-latest

Is it regression?

ubuntu-22.04

Expected behavior

To successfully install docker with docker-practice/actions-setup-docker@master

Actual behavior

The docker installation fails with:

  /usr/bin/sudo cat /etc/docker/daemon.json
  cat: /etc/docker/daemon.json: No such file or directory
  Error: Error: The process '/usr/bin/sudo' failed with exit code 1

Repro steps

Setup a github actions script with above configurations (maybe pinning to using ubuntu-24.04) and then the job fails with installing docker.

RaviAkshintala commented 1 week ago

Hi @hansehe Thank you for bringing this issue to us. We are looking into this issue and will update you on this issue after investigating

emarcey commented 1 week ago

Is there any update on this? I am experiencing the same issue, which is preventing my PR checks from running

emarcey commented 1 week ago

@hansehe fwiw, I was able to work around just now by switching runners to ubuntu-22.04 instead of ubuntu-latest

RaviAkshintala commented 1 week ago

Hi @hansehe Please replace ubuntu-24.04 to ubuntu-22.04 for now, and test your changes. It should work.

RaviAkshintala commented 3 days ago

Hi @hansehe We are awaiting for your reply, Thanks.

hansehe commented 3 days ago

Hi, and yes, it works by using an earlier version of Ubuntu. And please tell us when the newest version works again, and thanks for your help.

RaviAkshintala commented 1 day ago

Hi @hansehe Could you please try with the below workaround. Hope your issue will be resolved, Thanks.

https://github.com/RaviAkshintala/runner-images-Ravi/actions/runs/11286832733/workflow#L18