63

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  
0

5 Answers 5

88

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

BUILDKIT_PROGRESS=plain docker compose build
# or
BUILDKIT_PROGRESS=plain docker-compose build

or without buildkit which serves plain progress by default

DOCKER_BUILDKIT=0 docker compose build
# or
DOCKER_BUILDKIT=0 docker-compose build

using docker desktop 20.10.8 + docker-compose 2.0.1

Sign up to request clarification or add additional context in comments.

4 Comments

This works for me! Last comment I had the same issue than @Artfaith services.app.build Additional property progress is not allowed
This works in macOS in 2024 as well!
I noticed they now have deprecated DOCKER_BUILDKIT=0 Docker Desktop 4.40.0 (docker 28.0.4) DEPRECATED: The legacy builder is depreca ted and will be removed in a future release. BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0 environment-variable.
COMPOSE_PROGRESS=plain instead of DOCKER_BUILDKIT=0 worked in my case (Docker 28.3.2, Docker Compose v2.38.2-desktop.1).
12

For Compose V2. Refer to: Compose V2

Here is command originally shared by hasnat but modified to ComposeV2:

BUILDKIT_PROGRESS=plain docker compose build

Comments

5

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.

2 Comments

My workaround is to have docker-compose.yml reference the image image: image-name rather than doing build as part of compose. Then use a wrapper script that calls docker build --progress plain -t image-name && docker-compose up
Just in case, currently, it still returns: services.app.build Additional property progress is not allowed.
2

apparently it is not possible using compose file, but if you need it to be done always like this, you can write a wrapper:

docker-compose(){
        echo "[WARNING] runnig wrapper docker-compose..."
        if [ "$1" == "build" ]; then
            /usr/local/bin/docker-compose $@ --progress plain
        else
            /usr/local/bin/docker-compose $@
        fi
}

add this code to your ~/.profile or ~/.bash_profile

then you can use it as usual

** remember source your profile after edit

Comments

-6

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.