<p>I am using Build Toolkit to build docker image for each microservice.</p>

<p><strong>./build.sh</strong></p>

<pre><code>export DOCKER_BUILDKIT=1
# ....
docker build -t ....
# ... 
</code></pre>

<p>This works on my machine with docker (18.09.2).</p>

<p>However, it does not work with Jenkins, that I setup as following : </p>

<ul>
<li><p>EKS is provisioned with a Terraform module </p>

<pre><code>module "eks" {
  source   = "terraform-aws-modules/eks/aws"
  version  = "5.0.0"
  # ....
}
</code></pre></li>
<li><p>Jenkins is deployed on EKS (<code>v1.12.10-eks-ffbd9</code> , <code>docker://18.6.1</code>) via this <a href="https://github.com/helm/charts/tree/master/stable/jenkins" rel="nofollow noreferrer">Helm Chart</a>.</p></li>
<li><p>Jenkins plugins as defined in Values of the helm release: </p>

<ul>
<li>kubernetes:1.18.1</li>
<li>workflow-job:2.33</li>
<li>workflow-aggregator:2.6</li>
<li>credentials-binding:1.19</li>
<li>git:3.11.0</li>
<li>blueocean:1.19.0</li>
<li>bitbucket-oauth:0.9</li>
</ul></li>
<li><p>Jenkins Pipeline is declarative, and it uses a Pod template where the container image is <code>docker:18-dind</code> and the container name is <code>dind</code>.</p></li>
<li><p>This is my Jenkinsfile</p>

<pre><code>pipeline {
  agent {
    kubernetes {
      defaultContainer 'jnlp'
      yamlFile 'jenkins-pod.yaml'
    }
  }
  stages {
    stage('Build Backends') {
      steps {
        container('dind') {
          sh 'chmod +x *sh'
          sh './build.sh -t=dev'
        }
        containerLog 'dind'
      }
    }
  }
</code></pre>

<p>} </p></li>
</ul>

<p>When Jenkins executes this pipeline, it shows this error :</p>

<pre><code>buildkit not supported by daemon
</code></pre>

<p>I am not sure which software should I upgrade to make docker-buildkit work ? and to which version ?</p>

<ul>
<li>Terraform eks Module which is now 5.0.0 ?</li>
</ul>

<p>Or</p>

<ul>
<li>docker:18-dind image which behaves like environment of the ephemeral Jenkins slaves ?</li>
</ul>

<p>Or</p>

<ul>
<li>the Jenkins Plugin <code>kubernetes:1.18.1</code> ?</li>
</ul>

Abdennour TOUMI
<p>As per <a href="https://github.com/docker/docker-ce/blob/68852aa863516d5d3f2fc33f0a59e65d886a1671/components/cli/cli/command/image/build_session.go#L30" rel="nofollow noreferrer">docker-ce sources</a>, there are two requirements to make successful check <code>isSessionSupported</code> for starting <code>buildkit</code> session:</p>
<ul>
<li><code>dockerCli.ServerInfo().HasExperimental</code></li>
<li><code>versions.GreaterThanOrEqualTo(dockerCli.Client().ClientVersion(), &quot;1.31&quot;</code></li>
</ul>
<p>So:</p>
<ul>
<li>check version of your <code>docker-cli</code> library</li>
<li>and is <code>HasExperimental</code> option enabled.</li>
</ul>
<p>To check if it has Experimantal support, run:</p>
<p><code> docker version -f '{{.Server.Experimental}}'</code></p>
