The memory consumption is much less for PostgreSQL as can be seen below:
For MySQL one:
For PostgreSQL:
To run postgres with docker command execute:
docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=password -e POSTGRES_USER=user -e POSTGRES_DB=database -d postgres:alpine