Container hard disk and RAM allocation

Hello Community,

I am from OpenVZ background and am a beginner in Docker. When I create a docker container, I suppose some x amount of hard disk and y amount of RAM is dedicated/allocated to container.

I want to restrict my container to say, use 20Gb Hard disk and 500 MB RAM. Is is a possibility.
In OpenVZ I can mention this configuration in command line and also in container’s configuration file.

Please guide.

Thanks,
Ashay

For memory and CPU constraints, it pretty well documented in the official doc

As for the disk size, I am personally not aware of such a constraint, but others around here might know better. You can always create a limited VG on a lower level and map the volume to that VG as a workaround if nothing better comes up.