Docker compose unknown flags

Getting unknown flag for --no-cache and trying to rebuild containers.

I read that part of the manual, this used to work before the docker-compose was deprecated and now we have to use docker compose.

But I am having a hard time building containers without cache/rebuilding…
Using package docker-compose-plugin version 2.12 for raspbian…

This is the outcome of docker compose -f:

where is the no-cache option? or the force-recreate option?

Next time, please share the text itself, instead of a screenshot of the text.

The option --no-cache still exists for docker compose build:

me@host:~$ docker compose build --help

Usage:  docker compose build [OPTIONS] [SERVICE...]

Build or rebuild services

      --build-arg stringArray   Set build-time variables for services.
      --no-cache                Do not use cache when building the image
      --progress string         Set type of progress output (auto, tty, plain, quiet) (default "auto")
      --pull                    Always attempt to pull a newer version of the image.
  -q, --quiet                   Don't print anything to STDOUT
      --ssh string              Set SSH authentications used when building service images. (use 'default' for using your default SSH Agent)

Thanks, but I needed to pass the file flag since I am having two docker-compose.yml files as parameters… and i wanted to make sure that they were built without cache.
Every time I was typing docker compose build -f docker-compose.yml I was getting that error unknown shorthand flag: 'f' in -f, but I just got it now with
docker compose -f /home/pi/docker-compose.yml build --no-cache

@meyay only talked about the --no-cache flag. -f is still a parameter of compose as it is required for all subcommand when you change the default compose file path. Some programs let you use the global options after the subcommands. I guess that was what confused you.

It says the --progress flag is valid but I’m getting unknown flag: --progress in docker 23.0.0, docker compose 2.15.1

I just tried it on docker 23.0.1, compose plugin v2.16.0.

--progress plain:

me@docker:~/btest$ docker compose build --progress plain
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 254B done
#2 DONE 0.1s

#3 [internal] load metadata for
#3 DONE 0.0s

#4 [build2 1/3] FROM
#4 DONE 0.0s

#5 [build1 3/3] RUN sleep 10

#6 [build1 2/3] RUN touch /opt/binary1

#7 [final 2/3] COPY --from=build1 /opt/binary1 /opt/

#8 [build2 3/3] RUN sleep 10

#9 [build2 2/3] RUN touch /opt/binary2

#10 [final 3/3] COPY --from=build2 /opt/binary2 /opt/

#11 exporting to image
#11 exporting layers done
#11 writing image sha256:41be958e9075235ec46bce1589e08dcc0677c4ea1a58bff079f37b64925dd9ed done
#11 naming to done
#11 DONE 0.0s

--progress auto:

me@docker:~/test$ docker compose build --progress auto
[+] Building 0.0s (11/11) FINISHED
 => [internal] load build definition from Dockerfile                                                                                          0.0s
 => => transferring dockerfile: 254B                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                             0.0s
 => => transferring context: 2B                                                                                                               0.0s
 => [internal] load metadata for                                                                              0.0s
 => [build2 1/3] FROM                                                                                                0.0s
 => CACHED [build1 2/3] RUN touch /opt/binary1                                                                                                0.0s
 => CACHED [build1 3/3] RUN sleep 10                                                                                                          0.0s
 => CACHED [final 2/3] COPY --from=build1 /opt/binary1 /opt/                                                                                  0.0s
 => CACHED [build2 2/3] RUN touch /opt/binary2                                                                                                0.0s
 => CACHED [build2 3/3] RUN sleep 10                                                                                                          0.0s
 => CACHED [final 3/3] COPY --from=build2 /opt/binary2 /opt/                                                                                  0.0s
 => exporting to image                                                                                                                        0.0s
 => => exporting layers                                                                                                                       0.0s
 => => writing image sha256:7d19a75c1f13009c7e47626b94a60e830b293195e409b8ed798f4c16011ac7d5                                                  0.0s
 => => naming to                                                                                                       0.0s

Please upgrade your engine to 23.0.1 and see whether it fixes it.