简体   繁体   English

如何dockerize Xcode

[英]How to dockerize Xcode

For CI purposes I have a need to set up a cluster of build slaves capable of building iOS apps.出于 CI 目的,我需要建立一个能够构建 iOS 应用程序的构建从属集群。 For now I'm relying on a single MacMini -with the aim to deploy several more in the future- and I'd like to virtualize several slaves on top of it.目前,我依赖于单个 MacMini - 目的是在未来部署更多 - 我想在它上面虚拟化几个奴隶。 Some of these virtual slaves will build the iOS app, others will be smaller Linux slaves for miscellaneous purposes.其中一些虚拟从站将构建 iOS 应用程序,其他将是用于其他目的的较小的 Linux 从站。

I'm completely new to Docker, so my main question is whether it's possible to dockerize Xcode 9.2 and/or MacOS in order to virtualize my iOS build slaves.我对 Docker 完全陌生,所以我的主要问题是是否可以对 Xcode 9.2 和/或 MacOS 进行 dockerize 以虚拟化我的 iOS 构建从属。 I've seen very little literature out there on whether this can be achieved and I've found some images in hub.docker.com but they're not documented and don't appear to be very popular.我在那里看到的关于这是否可以实现的文献很少,我在 hub.docker.com 中找到了一些图像,但它们没有记录,而且似乎不太受欢迎。

I'm going through a Docker tutorial right now and eventually will be attempting this -and if I'm successful I'll be answering my own question here for the benefit of others- but given the lack of information I have doubts on whether it is even possible or where I should even start.我现在正在学习 Docker 教程,最终将尝试这个 - 如果我成功了,我将在这里回答我自己的问题以造福他人 - 但鉴于缺乏信息,我怀疑它是否甚至是可能的,或者我应该从哪里开始。

Any tips or pointers on this would be greatly appreciated.对此的任何提示或指示将不胜感激。 Or if anyone knows for fact that this is not possible and can explain why, that would also save me a lot of time.或者,如果有人确实知道这是不可能的并且可以解释原因,那也会为我节省很多时间。

OS X does not use the Linux kernel, so it cannot run in a Docker container OS X 不使用 Linux 内核,因此无法在 Docker 容器中运行

XCode is not open-sourced and does not have a Linux installer, so it cannot be used in a Linux Docker image. XCode 不是开源的,也没有 Linux 安装程序,因此不能在 Linux Docker 映像中使用。

It seems like your best bet is to build a Packer template using something like packer-macos osx-vm-templates and integrate that into your pipeline.似乎您最好的选择是使用类似 packer-macos osx-vm-templates 的东西构建一个 Packer模板,并将其集成到您的管道中。

Look at Docker-OSX which runs macOS with Xcode support inside Docker.看看Docker-OSX ,它在Docker内部运行 macOS 并支持 Xcode。

You can connect to that macOS via SSH or VNC.您可以通过 SSH 或 VNC 连接到该 macOS。 It might be possible to use the same approach in CI/CD.或许可以在 CI/CD 中使用相同的方法。

Related link from readme: "I want to use Docker-OSX for CI/CD-related purposes (sign into Xcode, Transporter)"自述文件中的相关链接: “我想将 Docker-OSX 用于 CI/CD 相关目的(登录 Xcode、Transporter)”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM