How to use Docker in macOS env?

I have a Swift package specifically for the macOS. It requires the use of Docker for some of the steps. Is there a suggested way to install and run Docker in the macOS env in the GitHub actions?

The quickest and easiest way is via Homebrew using

brew cask install docker

If you don’t have Homebrew, you can install it via

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

and then run the above command. There’s also a Mac OS installer available here:

Thanks @loganbek. It installs the desktop app but how would I get it running so that a command like docker version would work successfully?

1 Like

I believe you just need to run the application once (you should see the docker whale in your menu bar), and it will create the sym links so you can run commands like docker version. If that doesn’t work lets look at the output for:

$ ls -l /usr/local/bin/docker*

You can try to create a sym link yourself but this shouldn’t be necessary.

Oops, sorry :man_facepalming: I forgot to specify that I’m trying to get this to work in the GitHub actions.

1 Like

No worries. That explains your image. Anyway, let’s back up a bit. What is your overarching goal with the Swift Package, Docker, and Github Actions? I’ll need to know exactly what you are trying to accomplish in order to better steer you in the right direction.

Potentially useful links:

Thanks. I got it figured out. I just need a macOS env that I can run Docker in. I have an app I’m working on that is for use on the macOS. It builds Swift for Linux within a Docker container. Here is my working example of the workflow:

1 Like

Cool, thanks for sharing your solution :ok_hand: