I am using Build Toolkit to build docker image for each microservice.
./build.sh
export DOCKER_BUILDKIT=1
# ....
docker build -t ....
# ...
This works on my machine with docker (18.09.2).
However, it does not work with Jenkins, that I setup as following :
EKS is provisioned with a Terraform module
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "5.0.0"
# ....
}
Jenkins is deployed on EKS (v1.12.10-eks-ffbd9
, docker://18.6.1
) via this Helm Chart.
Jenkins plugins as defined in Values of the helm release:
Jenkins Pipeline is declarative, and it uses a Pod template where the container image is docker:18-dind
and the container name is dind
.
This is my Jenkinsfile
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'
}
}
}
}
When Jenkins executes this pipeline, it shows this error :
buildkit not supported by daemon
I am not sure which software should I upgrade to make docker-buildkit work ? and to which version ?
Or
Or
kubernetes:1.18.1
?Docker buildkit support came out of experimental in 18.09, so you may need to upgrade docker inside of EKS:
EKS (v1.12.10-eks-ffbd9 , docker://18.6.1
Or perhaps you have an old dind image (the 18-dind
should be new enough, but an older version of this tag pointing to 18.06 or 18.03 would not). You can try 18.09-dind
and 19-dind
which should both work if the build is actually happening inside dind.
According to docker-ce sources for starting buildkit
session, there are two requirements to make success check isSessionSupported
:
dockerCli.ServerInfo().HasExperimental
versions.GreaterThanOrEqualTo(dockerCli.Client().ClientVersion(), "1.31"
So, check version of your docker-cli
library and if it HasExperimental
option enabled.
To check if it has Experimantal support, you can run from shell:
docker version -f '{{.Server.Experimental}}'