I currently use docker to run my Symfony3. But I get this error when I try to run composer update
inside my container (after doing command docker exec -it <name of the bash container>
)
[ErrorException]
Proc_open (): fork failed - Can not allocate memory
The composer documentation asks to configure the swap of the machine but I get this error by following the steps of the documentation
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 (OK)
/sbin/mkswap /var/swap.1 (OK)
/sbin/swapon /var/swap.1 (KO)
-->
Swapon: /var/swap.1: swapon failed: Operation not permitted
(Even though I'm in root mode)
I finally found the answer to my problem.
You can start by adding space on your virtual machine (default). In my case I switched from 1GB to 2GB.
Then you can, if you wish, launch your container with the option --memory-swap = -1 or a space you have chosen
https://docs.docker.com/engine/admin/resource_constraints/#memory-swap-details
It's OK for me now ;) .
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments