docker rebuild container 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 force a rebuild
docker build --no-cache -t u12_core -f u12_core .
Example 3: docker rebuild single container
# this will only build a single container, instead of rebuilding all the containers
docker compose build <service_name>
docker compose up