devcontainers / devcontainers/features
`docker-in-docker` feature wastes RAM by mounting `/tmp` to tmpfs
- Vorherrschende Sprache
- Shell
- Sterne
- 1.5k
- Forks
- 621
- Ø Merge
- 6 T. 53 Min.
- Gemergte PRs (30 T.)
- 9
Beschreibung
It seems like adding the feature like so:
```jsonc
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
}
}
```
Mounts `/tmp` to tmpfs on default:
https://github.com/devcontainers/features/blob/3cc059ea8abf3a909468fafabca481f82b6f8924/src/docker-in-docker/install.sh#L353-L356
Which results in some unexpected behaviours:
1. The `/tmp` directory is now limited by the amount of RAM that is available, which results in `Out of space` Exception for programs using a lot of `tmp` space (or users with limited amount of RAM).
2. The RAM of the host system is wasted for `tmp` files.
#### Workaround:
Mounting your own volume to `/tmp`:
`"runArgs": ["--mount", "type=volume,target=/tmp/"],`
#### Related
Here is my way of suffering: https://stackoverflow.com/questions/75630189/why-and-where-is-the-tmp-directory-size-limited-in-vscode-devcontainers ;)
Beitragsleitfaden
Rechercherichtung
Beginne mit src/docker-in-docker/install.sh um die Zeilen 353-356, wo das Feature /tmp mountet, und untersuche das standardmäßige Mount-Verhalten. Vergleiche es mit dem gemeldeten Volume-Workaround und überprüfe, dass das Feature /tmp nicht mehr unerwartet auf den RAM des Hosts beschränkt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- docker, shell
- Bereich
- devops
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100