5

This is snipshet of my code:

   stage('tf run') {
  agent {
    dockerfile {
      additionalBuildArgs "${ADDITIONAL_BUILD_ARGS}"
      registryCredentialsId "${REGISTRY_CREDENTIALS}"
      registryUrl "${REGISTRY_URL}"
      reuseNode true
    }
  }

Now I want do add special variable DOCKER_BUILDKIT=1 when I run this peace of code. For example in a shell it should look like: "DOCKER_BUILDKIT=1 docker build ." I need it because I want to run my docker in docker_buildkit mode. How can I do this?

debek
  • 331
  • 7
  • 15

1 Answers1

10
environment {
    DOCKER_BUILDKIT='1'
}

Putting it in as an env variable in your pipeline will work

Ray
  • 1,134
  • 10
  • 27