Can I run Xcode in a docker container? - xcode

Can I run Xcode in a docker container? I'd like to dockerise an Xcode CI system, just wondering if this is possible.

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:
https://www.youtube.com/watch?v=CGHOH9Ocl1k
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).

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

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/

Related

Cant start docker containers from Docker Desktop in Mac

I've used docker desktop in Linux and Windows without problem, but i recently got a mac, and when i try to start a docker container i have setup via Docker Desktop, the docker container starts, but immediately just changes from "Running" to "exited" status.
This doesnt happen in the other environments i use docker, so any help would be appreciated.
I have been trying to find any kind of logs, but i cant find any.
im using mac os x 11.7.1 (Big Sur)
Docker desktop is the newest version 4.16.2
I have tried so far:
Reinstalling Docker Desktop
verified and ensured the permissions for access to docker are set correctly (access to files and folders)
I have setup my dockerhub account
Im using the latests versions of the php and python images available at docker hub.
Thank you.

Ionic build with docker and jenkins

I am new to docker and I want to have the ionic environment/build dockerized. I have some steps in mind however for me it is not clear if I can run any xcode command in Docker.
Steps:
- Docker container with jenkins
- Run a build for ios with jenkins job if I am in a MacOS machine running Docker for MacOS (I heared that it is different from boot2docker but I have not tried yet)
- Docker container with android environment
- Run a build for android with jenkins job
Any suggestions?

build Docker images from GitLab

The last two weeks I'm searching for ways to automate the build of apps and as docker images/containers on Windows. There are some issues building containers currently:
GitLab runner issue
What I've done:
Running selfhosted GitLab installation
Windows 2016 trial
Docker is installed, docker -Version works
GitLab multirunner installed
Configured Runner in GitLab
HelloWorld Example build with runner worked
I'm wondering if there is somebody that could share some knowlegde about building Windows docker images from a GitLab repro.
The reason I would like to use Windows is a work related tryout :)

How does docker run on osx, does it use vagrant?

I use an older model MB Air and running vagrant is very resource intensive for me.
When using docker on OSX, does it just use vagrant behind the scenes to run my docker instance on ubuntu?
In contrast to the deprecated Docker Toolbox (which also runs on MacOS), recent versions of Docker for Mac do not use VirtualBox, but rather HyperKit, a native MacOS hypervisor, which is built on xhyve. In comparison to VirtualBox, HyperKit claims to be more lightweight.
Also consider the official documentation on the differences and interna of Docker Toolbox and Docker for Mac (emphasis mine):
Docker for Mac is a Mac native application, that you install in /Applications. [...]
Here are some key points to know about Docker for Mac before you get started:
Docker for Mac does not use VirtualBox, but rather HyperKit, a lightweight macOS virtualization solution built on top of Hypervisor.framework in macOS 10.10 Yosemite and higher. [...]
The Docker for Mac application does not use docker-machine to provision that VM; but rather creates and manages it directly.
At installation time, Docker for Mac provisions an HyperKit VM based on Alpine Linux, running Docker Engine. It exposes the docker API on a socket in /var/run/docker.sock. Since this is the default location where docker will look if no environment variables are set, you can start using docker and docker-compose without setting any environment variables.
[...]
With Docker for Mac, you get only one VM, and you don’t manage it. It is managed by the Docker for Mac application, which includes autoupdate to update the client and server versions of Docker.
It doesn't use Vagrant, but it there is underlying VirtualBox machine similar to what Vagrant uses. Things might be slightly better with Docker because the docker VM is very slimmed down version. And you can pack multiple images into that VM in more efficient manner, because they will be using the same kernel and IO layers.
Also, note that with both Vagrant and Docker you can use AWS or similar cloud things to actually run your images.

Setting up GitLab CI on server with GitLab already installed

I have a server running CentOS 6.5, and I have already installed GitLab on it. I wanted to install GitLab CI as well - will installing it overwrite my current GitLab installation or is it completely separate from it?
I use both GitLab and GitLab CI all on the same host and it works fine - they are totally separate applications and work well together. Each application is installed into it's own home. I don't, but you could also run the GitLab CI Runner on the same box too.
Just follow the GitLab CI how-to and you'll be up and running in no time!
https://github.com/gitlabhq/gitlab-ci/blob/5-2-stable/doc/install/installation.md
A possible approach would be to use:
Docker
a DockerFile (like darthmuffins/gitlab-ci-runner-centos/Dockerfile, or the project sameersbn/docker-gitlab-ci-runner) in order to make a separate GitLab CI instance (running on the same server but acting like its own independent server).
In your case, that might be difficult, since CentOS 6.5 is built from the source packages of RHEL 6 update 5 (also known as RHEL version 6.5, kernel 2.6.32-431), which means Docker might not be fully supported.

Resources