Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker compose with build --pull option

What is the equivalent of docker build --pull . in a docker-compose?

The docker compose reference only indicates build context, build file, and build args, but I can't find syntax to specify build options inside a docker compose.

like image 249
Scott Chang Avatar asked Oct 19 '25 04:10

Scott Chang


1 Answers

It's the same docker-compose build --pull:

$ docker-compose build --help
Build or rebuild services.

Services are built once and then tagged as `project_service`,
e.g. `composetest_db`. If you change a service's `Dockerfile` or the
contents of its build directory, you can run `docker-compose build` to rebuild it.

Usage: build [options] [SERVICE...]

Options:
    --force-rm  Always remove intermediate containers.
    --no-cache  Do not use cache when building the image.
    --pull      Always attempt to pull a newer version of the image.
like image 196
BMitch Avatar answered Oct 21 '25 20:10

BMitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!