From 3ec20522c16fdf9d6d2f5ec76b3aaae78ed12358 Mon Sep 17 00:00:00 2001 From: Markus Baertschi Date: Fri, 17 Jan 2025 21:52:25 +0100 Subject: [PATCH 1/2] Optionally add --network to docker build --- compile-with-docker.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compile-with-docker.sh b/compile-with-docker.sh index eaa6061..69ec1b2 100755 --- a/compile-with-docker.sh +++ b/compile-with-docker.sh @@ -1,8 +1,14 @@ #!/bin/sh #export DOCKER_DEFAULT_PLATFORM=linux/amd64 +#export DOCKER_NETWORK="--network=host" IMAGE_NAME="uvk5" rm "${PWD}/compiled-firmware/*" -docker build -t $IMAGE_NAME . +echo "Building docker image $IMAGE_NAME" +if ! docker build -t $DOCKER_NETWORK $IMAGE_NAME . +then + echo "Failed to build docker image" + exit 1 +fi custom() { echo "Custom compilation..." From af891c6b6ad1c96f416e428fbb52e345253e63f6 Mon Sep 17 00:00:00 2001 From: Markus Baertschi Date: Fri, 17 Jan 2025 21:54:59 +0100 Subject: [PATCH 2/2] Add sentence about DOCKER_NETWORK --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4faa1c..72d0f9b 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ This is the least demanding option as you don't have to install enything on your ### Docker build method -If you have docker installed you can use [compile-with-docker.bat](./compile-with-docker.bat) (Windows) or [compile-with-docker.sh](./compile-with-docker.sh) (Linux/Mac), the output files are created in `compiled-firmware` folder. This method gives significantly smaller binaries, I've seen differences up to 1kb, so it can fit more functionalities this way. The challenge can be (or not) installing docker itself. +If you have docker installed you can use [compile-with-docker.bat](./compile-with-docker.bat) (Windows) or [compile-with-docker.sh](./compile-with-docker.sh) (Linux/Mac), the output files are created in `compiled-firmware` folder. This method gives significantly smaller binaries, I've seen differences up to 1kb, so it can fit more functionalities this way. The challenge can be (or not) installing docker itself. You may need to uncomment and customize the DOCKER_NETWORK environment variable in the script. ### Windows environment build method