What kind of executor should I use for running my iOS/macOS pipelines in GitLab runners?

Modified on Sun, 30 Jul 2023 at 03:33 PM

For running iOS/macOS pipelines in GitLab runners, you should use the "shell" executor or the "docker" executor with a macOS image.


Shell Executor:

The "shell" executor is the default executor for GitLab runners and is suitable for running CI/CD jobs on a single machine. When using the "shell" executor, the GitLab runner directly executes commands on the host machine's shell. This is a simple and straightforward option for macOS projects, especially if you have a dedicated macOS machine or a macOS virtual machine for running CI/CD jobs.


Docker Executor with macOS Image:

If you prefer using Docker containers for your CI/CD jobs, you can choose the "docker" executor with a macOS Docker image. This allows you to run your macOS pipelines within isolated Docker containers, providing better control over dependencies and reproducibility. It's also useful if you have a shared runner infrastructure with other platforms like Linux and Windows, as Docker allows you to encapsulate macOS-specific dependencies and configurations.


To use the "docker" executor with a macOS image, you'll need to:


a. Ensure Docker is installed on the macOS machine.

b. Pull or build a macOS Docker image that includes the necessary tools and dependencies for your iOS/macOS projects.

c. Configure your GitLab runner to use the macOS Docker image in the GitLab runner's configuration file.


Here's a sample configuration in the GitLab runner's config.toml file for using a macOS Docker image:



[[runners]]
  name = "My macOS Runner"
  url = "https://gitlab.com/"
  token = "your-gitlab-runner-token"
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = "your-macos-docker-image:latest"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0



Keep in mind that using the "docker" executor with macOS images may require additional setup and configuration, but it offers greater flexibility and isolation for running macOS pipelines within containers.


Ultimately, the choice between the "shell" and "docker" executor depends on your specific requirements and infrastructure setup. Both options can effectively run iOS/macOS pipelines in GitLab runners.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article