Add --no-log-init to the node user that gets created to avoid massive image sizes
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- docker, dockerfile
- Ambito
- build-system, devops
Direzione di ricerca
Cerca nelle definizioni di build delle immagini Docker ogni comando useradd che crea l’utente node, iniziando dal comando mostrato nell’issue. Aggiungi l’opzione richiesta a ogni comando applicabile, quindi esegui la build delle immagini interessate e verifica che l’avviso di Hadolint segnalato sia stato risolto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Currently the node user is created with useradd --uid 1000 --gid node --shell /bin/bash --create-home node.
When customizing the UID / GID using build args with groupmod -g "${GID}" node && usermod -u "${UID}" -g "${GID}" node, some folks are reporting they are running out of disk space and can't build the image when they have a non-1000 UID on systems that create a lot of users.
Here's a comment going into more detail: https://github.com/nickjj/docker-flask-example/pull/7#issuecomment-1266698181
Also not using --no-log-init will cause Hadolint to throw this warning: -:44 DL3046 warning: useradd without flag -l and high UID will result in excessively large Image.
The usermod command doesn't support being able to set that option so it means our only option is to delete the node user and create a new one in which case life could be simplified by setting that flag here. You could make a case this is a bug report and not feature request due to the implications of not setting this flag when you create users in a Docker image.
Solution
Add --no-log-init to all of the useradd commands that create the node user.
- Lingua principale
- Dockerfile
- Stelle
- 8.6k
- Fork
- 2k
- Merge medio
- 10h 19m
- PR unite (30g)
- 16
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nodejs/docker-node
-
build process docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nodejs/docker-node#2564 · 2 commenti ·
-
build process
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nodejs/docker-node#2437 ·
-
build process
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
nodejs/docker-node#2436 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nodejs/docker-node#1707 · 3 commenti · 7 reazioni ·
-
docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nodejs/docker-node#1101 · 2 commenti ·
Tutte le issue di nodejs/docker-node
Issue simili
-
type/automation type/tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
priority: p3
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
googleapis/librarian#7636 ·
-
Update gh-dash to 4.26.0 Apertapackage-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 commento ·
-
Builders
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100