Search code examples
dockermacosjenkinsjenkins-agent

Jenkins through docker: How to configure own host as agent for jenkins?


I'm using Jenkins with pipelines on a mac-mini. All builds are working fine with docker agents (backend, frontend, android app, etc)

The only thing I haven't been able to achieve is to use my own mac-mini as build-agent for the I\iOS app (I need to build on MacOS). Jenkins itself runs through docker as well, so I would need to connect to the host (the OS of the mac-mini) and use that as an agent...

I know one option would be to install Jenkins instead of using docker, but I would prefer to keep Jenkins running in a docker container.

Does someone has experience with this or knows any good documentation on how to set this up?


Solution

    1. Go to Manage Jenkins > Manage Nodes > New Node.
    2. Configure a node.
    3. Go to the list of nodes.
    4. Select your newly configured node. It should be offline at this moment.
    5. Run the java command displayed on the interface on your host machine.
    6. Your Host machine is now a slave.