Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
Amazon ECS support for --shm-size in docker

I am trying to use AWS EC2 Container Service (ECS) in order to run a dockerized webdriver (Selenium) Grid. According to docker-selenium github page, we need to either add some shared memory or mount a volume to the docker container if we want to run long running tests using the chrome browser on the selenium-node-chrome image.

On my EC2 instance, when I do a

df -h

I see that /dev/shm exists and has 3.7Gb of available free space. But if I mount the volume to my chrome-node container using the -v /dev/shm:/dev/shm property, the browser is not even coming up when I run a test. But if I mount the parent /dev directory, tests seem to run for a few seconds and then I get the "Unable to reach Browser exception" because the browser is then getting closed (I was able to confirm this through VNC Viewer). This makes me realize that mounting a volume through ECS interface / api is not gonna help.

If I directly start docker without going through the ECS route by passing the --shm-size property like

docker run --shm-size=2500m ....

The tests seem to run without any trouble.

But, ECS clearly does not support the --shm-size property as of now. So how to fix or work around this issue and still use ECS to pass the --shm-size property? Is avoiding the usage of ECS the only way here or is there any other better way?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

A workaround:

Add below (EntryPoint) command as the last line in your dockerfile

ENTRYPOINT shm_dir=/dev/shm;umount $shm_dir;mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=*<size eg. 500m,1Gb>* shm $shm_dir  && /bin/bash

I have tested this change in local docker, although it requires --privileged or at least --cap-add SYS_ADMIN. I have yet to test it on AWS.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!