Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting docker build to show IDs of intermediate containers

Tags:

docker

I'm trying to learn docker but experience some discrepancies to what I've read in each tutorial:

When using the following command docker build -t my-app:1.0 . my build fails due to some error in my Dockerfile. Following this answer, I wanted to run the last intermediate container ID. Anyhow, in contrast to all tutorials I've seen so far, my console is not showing any intermediate container IDs: enter image description here

I'm running Docker 19 on Windows 10. How do I get the intermediate container IDs?

like image 743
Comfort Eagle Avatar asked Jan 07 '21 14:01

Comfort Eagle


2 Answers

You don't need to disable buildkit permanently for this and you shouldn't because it will make all your builds slower. You can just set an environment variable when you docker build, like this:

Powershell

$env:DOCKER_BUILDKIT=0; docker build .

Linux/macOS

DOCKER_BUILDKIT=0 docker build .

Windows cmd

set DOCKER_BUILDKIT=0& docker build .
like image 64
Adam Cooper Avatar answered Oct 04 '22 14:10

Adam Cooper


I had the same problem. Setting "buildkit" to false in ~/.docker/daemon.json (In Windows you should find daemon.json in C:\ProgramData\Docker\config) solved this for me:

    {
      "experimental": true,
      "features": {
        "buildkit": false
      }
    }
like image 36
Michael Avatar answered Oct 04 '22 15:10

Michael