Resources usage by container

Hello,

How Docker manage resources especially RAM and CPU usage.
For example I run two containers:

1# Postgres
2# Application

Total memory of host is 8GB.

  • How then it will use memory?
  • Is this possible to tweak limit resources for certain container?
    Let’s say I want give for container no1. 6GB of RAM and rest for container no.2

I would be surprised if somone actualy runs container in production without setting ressource constraints (reservations/limits) for CPU and RAM.

Check the documentation of docker cli or the compose file reference on how to apply the settings.