Can I run Xcode in a docker container?
XcodeDockerXcode Problem Overview
Can I run Xcode in a docker container? I'd like to dockerise an Xcode CI system, just wondering if this is possible.
Xcode Solutions
Solution 1 - Xcode
This answer is now likely to be out of date as it was written in 2015. It may still be useful as reference to reproduce the same
--
This repo from Docker Hackathon 2015 describes how to build and run iOS apps with the docker client. Is that what you're after?
Watch the video:
Secret sauce is in server.js that implements a REST API to simulate a docker server. So in fact it's not actually running iOS in a real Linux docker server - rather it implements the docker API and then acts as a proxy to ios-sim (run) and XCode (build).
Solution 2 - Xcode
Look at Docker-OSX which runs macOS with Xcode support inside Docker.
You can connect to that macOS via SSH or VNC and use Xcode on Linux
Solution 3 - Xcode
Circle CI has an option to use Xcode in a container. Here is an excerpt of my ci pipleline config:
ios-build-env: &ios-build-env
macos:
xcode: "11.4.1"
jobs:
ios-deploy:
<<: *ios-build-env
steps:
- checkout
...
Circles docs: https://circleci.com/docs/2.0/testing-ios/