composer cannot allocate memory inside container docker

nkweb

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)

nkweb

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.

edited at
0

Comments

0 comments
Login to comment

Related

tail in a Docker container: Cannot allocate memory

PHP Composer update "cannot allocate memory" error (using Laravel 4)

How to install PHP composer inside a docker container

sudo: main: unable to allocate memory (Inside of Linux Container)

XZ - Cannot allocate memory

mmap: Cannot allocate memory

Cannot allocate memory

cannot allocate memory error

Ruby: Cannot allocate memory

Cannot send mail from inside docker container

Cannot use NGINX subdomain inside the Docker container

Composer - PHP Warning: proc_open(): fork failed - Cannot allocate memory

Running Docker inside Docker container: Cannot connect to the Docker daemon

Malloc cannot allocate memory for a structure

Buffer NULL!: Cannot allocate memory

-bash: fork: Cannot allocate memory

Why mmap cannot allocate memory?

Apache crash : Cannot allocate memory

Cannot allocate memory with tshark in Python

Cannot call chown inside Docker container (Docker for Windows)

Why can't composer find a composer.json file inside my Docker container?

Does an unused STL container allocate memory?

Root user inside Composer container

Cannot run Remove-IISSite inside a windows docker container

Cannot start a Jupyter notebook from inside this docker container

Spring Microservices Cannot Connect Via Eureka When Inside Docker Container

Github Actions cannot write to file, permission denied (Inside the docker container)

Cannot exchange AccessToken from Google API inside Docker container

Cannot create directory. Permission denied inside docker container