docker compose building for 20min code example

Example 1: docker-compose force rebuild

# Build images before starting containers.
docker-compose up --build
# Recreate containers even if configuration/image hasn't changed.
docker-compose up --force-recreate

Example 2: docker-compose build image with args

Usage: build [options] [--build-arg key=val...] [SERVICE...]

Options:
    --build-arg key=val     Set build-time variables for services.
    --compress              Compress the build context using gzip.
    --force-rm              Always remove intermediate containers.
    -m, --memory MEM        Set memory limit for the build container.
    --no-cache              Do not use cache when building the image.
    --no-rm                 Do not remove intermediate containers after a successful build.
    --parallel              Build images in parallel.
    --progress string       Set type of progress output (`auto`, `plain`, `tty`).
    --pull                  Always attempt to pull a newer version of the image.
    -q, --quiet             Don't print anything to `STDOUT`.

Tags:

Misc Example