actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.64k stars 890 forks source link

macos-13-xlarge (i.e. Mac Arm Processor) Unable to Install and Start Docker #3012

Open SachaTe opened 7 months ago

SachaTe commented 7 months ago

Describe the bug We have been trying to install docker on the Mac Arm runner and have not been successful.

To Reproduce Steps to reproduce the behavior:

jobs:
  build-and-test:
    runs-on: 'macos-13-xlarge'

    steps:
      - name: Docker Test
        run: |
          softwareupdate --install-rosetta --agree-to-license
          brew install --cask docker
          docker run hello-world

Expected behavior Docker should run

Runner Version and Platform

0s
Current runner version: '2.3[1](https://github.com/hinge-health/cv-engine/actions/runs/7024641202/job/19113810137#step:1:1)1.0'
Operating System
  macOS
  13.6.1
  [2](https://github.com/hinge-health/cv-engine/actions/runs/7024641202/job/19113810137#step:1:2)2G[3](https://github.com/hinge-health/cv-engine/actions/runs/7024641202/job/19113810137#step:1:3)13
Runner Image
  Image: macos-13-arm6[4](https://github.com/hinge-health/cv-engine/actions/runs/7024641202/job/19113810137#step:1:4)
  Version: 2023111[5](https://github.com/hinge-health/cv-engine/actions/runs/7024641202/job/19113810137#step:1:5).2
  Included Software: https://github.com/actions/runner-images/blob/macOS-13/20231115.2/images/macos/macos-13-arm[6](https://github.com/hinge-health/cv-engine/actions/runs/7024641202/job/19113810137#step:1:7)4-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macOS-13%2F20231115.2
Runner Image Provisioner
  2.0.321.1
GITHUB_TOKEN Permissions
  Actions: write
  Checks: write
  Contents: write
  Deployments: write
  Discussions: write
  Issues: write
  Metadata: read
  Packages: write
  Pages: write
  PullRequests: write
  RepositoryProjects: write
  SecurityEvents: write
  Statuses: write
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Complete job name: build-and-test

What's not working?

We get error;

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

Runner and Worker's Diagnostic Logs

I have looked online and tried multiple steps which all fail. For example:

  1. Tried installing and starting colima
  2. Tried opening docker via open --background -a Docker but get error Unable to find application named 'Docker'
  3. When I run /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check I see
    [2023-11-28T20:37:19.832714000Z][com.docker.diagnose.ipc][W] (c4f9edb7) 05552d74-diagnose C<-S NoResponse GET /idle (1.214209ms): Get "http://ipc/idle": dial unix <HOME>/Library/Containers/com.docker.docker/Data/backend.sock: connect: no such file or directory
    [2023-11-28T20:37:27.894723000Z][com.docker.diagnose.ipc][I] (b192c3da) 05552d74-diagnose C->S BackendAPI GET /idle
    [2023-11-28T20:37:27.894996000Z][com.docker.diagnose.ipc][W] (b192c3da) 05552d74-diagnose C<-S NoResponse GET /idle (270.458µs): Get "http://ipc/idle": dial unix <HOME>/Library/Containers/com.docker.docker/Data/backend.sock: connect: no such file or directory
  4. Tried adding sudo ln -s ~/.docker/run/docker.sock /var/run/docker.sock but it seems like the sock is just never created
bryanmacfarlane commented 7 months ago

does this help? https://stackoverflow.com/questions/44084846/cannot-connect-to-the-docker-daemon-on-macos

James-Mart commented 7 months ago

I also need docker on the latest m1 runners. I'm trying to build arm64 images natively without qemu emulation (because emulation is too slow).

SachaTe commented 6 months ago

@James-Mart you figure anything out ? All my attempts have failed

James-Mart commented 6 months ago

@James-Mart you figure anything out ? All my attempts have failed

Same, all my attempts failed. I've decided to simply wait until arm64 linux runners are available, which presumably will have docker. That is apparently scheduled for January 2024, or at least will be in private beta.

khvn26 commented 6 months ago

Trying to solve the same problems, we've had some success with rogisolorzano/github-runner-ec2-start and rogisolorzano/github-runner-ec2-stop GH actions to spin up our own Graviton EC2 runners.

We tried to spin up OrbStack on GH's M1 runners but they have virtualization disabled so it didn't work.

On EC2, Qemu was still extremely slow in some cases during multiarch builds so we switched to depot.dev for our Docker builds.

kamesh-09 commented 3 months ago

Any update or progress on this ?

kgantchev commented 2 months ago

macOS runners, such as the ones provided by GitHub, are being run in an ephemeral VM that runs in Apple's virtualization framework. Apple does not support nested virtualization so you can't run Docker inside a macOS VM.

Best Regards, Kiril Gantchev CEO and co-founder of FlyCI