utils/docker-run: add NO_NETWORK variable

It is sometimes useful to be able to do an offline build, to make sure
the build works properly without network access, so this commit adds a
NO_NETWORK environment variable to our docker-run script, which for
example allows to do:

$ ./utils/docker-run make source
$ NO_NETWORK=1 ./utils/docker-run make

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit d6f816facc)
Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
This commit is contained in:
Thomas Petazzoni
2026-09-28 09:46:41 +02:00
committed by Raphaël Mélotte
parent b7ef4f78cc
commit 95f448c511

View File

@@ -21,7 +21,7 @@ declare -a docker_opts=(
--user "$(id -u):$(id -g)"
--workdir "$(pwd)"
--security-opt label=disable
--network host
--network "$([ "${NO_NETWORK:-0}" -eq 1 ] && echo none || echo host)"
)
declare -a mountpoints=(