Comments (7)
I ran into an issue earlier tonight trying to run chrome headless on lambda. It worked perfectly on the docker container but chrome never launched on lambda until I tracked down that lambda doesn't have /dev/shm
with chrome 64+ --disable-dev-shm-usage
moves from /dev/shm
to /tmp
. Could these images also restrict /dev/shm
to not exist? like the real lambda environment?
from docker-lambda.
Are you sure this is something that's provided by this image? I haven't checked but I highly doubt it.
If anything it's probably something that Docker itself adds
from docker-lambda.
Confirmed – there's no /dev/shm
in the image:
curl -s https://lambci.s3.amazonaws.com/fs/nodejs4.3.tgz | tar -t | grep '^dev/'
dev/
dev/stdout
dev/null
dev/random
dev/full
dev/urandom
dev/zero
dev/stderr
dev/stdin
It appears that Docker adds this when it creates a container (ie, when you docker run
) – see the reference here:
https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources
Specifically the --shm-size
arg:
Size of /dev/shm. The format is . number must be greater than 0. Unit is optional and can be b (bytes), k (kilobytes), m (megabytes), or g (gigabytes). If you omit the unit, the system uses bytes. If you omit the size entirely, the system uses 64m.
Given that it must be greater than zero there doesn't seem to be a way to run a container without Docker adding it. You could specify it as one byte – that might have a similar effect? Or you'll have to rely on the complicated unmounting procedure you outlined.
In any case, I don't think there's anything that can be done about the image itself on this front
from docker-lambda.
I will give that a go, thanks for the quick follow up @mhart !
from docker-lambda.
@kadrach any success on this front?
from docker-lambda.
Here are some things I tried which do not work:
rm -rf /dev/shm
FROM lambci/lambda:build-python3.8
RUN rm -rf /dev/shm
Permission error because we're not root (but we are)
Overwrite /dev/shm
FROM lambci/lambda:build-python3.8 as src
RUN echo "abc" > /file.dat
FROM lambci/lambda:build-python3.8 as main
COPY --from=src /file.dat /dev/shm
Nope, once again docker build discards the changes to /dev/shm.
I think it's not specific to /dev/shm, and actually docker ignores changes to /dev
.
--shm-size=0
Running with --shm-size=0
doesn't work. Docker ignores a zero value
Other?
Maybe there's another way to emulate multiprocessing.Pool failing? (e.g. some global python config?)
I'm not sure what would do that though. I looked through the relevant cpython code. I'm not sure where exactly the error is thrown.
Maybe here?
from docker-lambda.
--ipc=none
works for me.
from docker-lambda.
Related Issues (20)
- Missing files from provided.al2 HOT 1
- Need support for python3.9 HOT 10
- nodejs16.x support HOT 6
- Golang update to 1.17 HOT 1
- Is java11 image on AL2 and Corretto?
- How can I build image for python3.9 runtime? HOT 4
- Help with Debugging Go Lambda HOT 1
- Rebuild images? HOT 2
- What is the status of this project? HOT 7
- Make `myfunction` and `9001` configurable?
- Support for Node 14.x? HOT 1
- Boto3 and botocore need upgrading HOT 5
- Require image for ARM64 architecture
- Support for .NET 6
- Multi-arch support specially arm64 HOT 1
- Current ruby release (v2.7.2p137) out of date (now v2.7.6p?) HOT 1
- Missing .py file causing attributeError on lambda
- Jenkins agent install on lambci/lambda:build-python3.7 HOT 2
- Debugging with Pycharm
- [Question] Support for Provided Runtimes (Namely C++)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-lambda.