'Enable "progress plain" in docker-compose file

When I run a build using docker-compose build --progress plain, it shows more useful information during the build than the default BuildKit output.

Is there a way to embed the plain progress option into the docker-compose.yml file itself so I can just call docker-compose build and still get the better output?

I tried adding these build args, but none of them seemed to work:

build:
    args:
        #progress: plain  
        #- progress=plain  
        #- progress plain  
        #BUILDKIT_PROGRESS: plain  
        #- BUILDKIT_PROGRESS=plain  


Solution 1:[1]

Even though it seems like it ought to be possible looking at the current implementation of docker-compose, notably the _CLIBuilder which is invoked over the services dict's build method.

However, no such similarly-named key exists in the configuration schema.

So it appears that you can't, at least not yet.

Incidentally, from the above, I'd expect to eventually find it here

services:
    build:
        progress: plain

rather than the args: child key.

Solution 2:[2]

Where you don't want to disable buildkit, one can use

BUILDKIT_PROGRESS=plain docker-compose build

or without BUILDKIT which serves plain progress by default

DOCKER_BUILDKIT=0 docker-compose build

using docker desktop 20.10.8 + docker-compose 2.0.1

Solution 3:[3]

It seems the docker-compose.yaml accepts an args field:

version: "3.8"
services:
  main:
    build:
      context: .
      dockerfile: se/Dockerfile
      args:
        progress: plain

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 msanford
Solution 2
Solution 3 Amin Shojaei