I need to add --shm-size command to docker run while I deploy container image from Container Registry.
According to documentation I need to use Arguments fields under Advanced container options but it doesn't work for me.
I've added --shm-size 1G line like that:

docker exec -it 68d... df -h still returns default shm size:
shm 64M 0 64M 0% /dev/shm
Could somebody suggest how can I solve my issue?
I also have tried to increase it manually inside docker container but faced
mount: /dev/shm: permission denied. issue.
UPDATE
Solution:
I've created a bash script as an entry point which is set up /dev/shm size manually:
#!/bin/bash
echo "none /dev/shm tmpfs defaults,size=500m 0 0" >> /etc/fstab
mount -o remount /dev/shm
dotnet Worker.dll
Dockerfile:
....
USER root
COPY ["Worker/start.sh", "app/"]
CMD ["/bin/bash", "app/start.sh"]
Arguments under the advance container option is just like passing arg to ENTRYPOINT. Query compute metadata "gce-container-declaration" using command from the container vm 'curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/gce-container-declaration"'
For your use case, create non-container VM, then install the docker yourself and run a container using our docker shm arg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With