Search code examples
windowsdockerjenkinsbuilddocker-image

How to build Docker images for Windows in Jenkins


I do have a Jenkins instance running in a Linux machine. I would also like to build Docker Images (Windows containers). I was not able to find an example anywhere.


Solution

  • I've found out there is a plugin for Jenkins that is able to interact with cloud/remote Docker installations. https://plugins.jenkins.io/docker-plugin/

    You just need to enable remote acces in the Docker Daemon Configuration as below and configure the plugin to use this installation as a its builder.

    {
      "registry-mirrors": [],
      "insecure-registries": [],
      "debug": true,
      "experimental": false,
      "hosts": [
        "tcp://0.0.0.0:2375"
      ]
    }