How to docker build
from Dockerfile with more memory?
This is a different question from this Allow more memory when docker build a Dockerfi
It is not something about order. The Dockerfile must be specified with -f
docker build -f Dockerfile.cpu -t ibot-cpu -m 4g .
As you can see in the help.
However, take into account that by default docker does not limit the container memory. It can take the whole free memory.
As I can see that you are on OSX, which runs docker over a Linux VM. Configure the max memory clicking the whale icon in the task bar. By default is 2G.
For further information please see my other answer: How to assign more memory to docker container