From 69dac92357381767cb24a9db093fed9916769685 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Mon, 22 Dec 2025 13:27:23 +0100 Subject: [PATCH 1/4] Dockerfile: add force-udf directly Put the force-udf layer first since that does not change frequently, and add the repository directly so the Docker cache can be used to speed up the image build. --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a0b5472..07c7f759 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 ########################################################################## # # This file is part of FORCE - Framework for Operational Radiometric @@ -50,14 +51,12 @@ RUN echo "building FORCE" && \ make clean && \ cd $HOME && \ rm -rf $SOURCE_DIR && \ - force-info && \ -# clone FORCE UDF - git clone https://github.com/davidfrantz/force-udf.git + force-info FROM davidfrantz/base:latest AS force +ADD --link --chown=ubuntu:ubuntu --exclude=.github https://github.com/davidfrantz/force-udf.git $HOME/udf COPY --chown=ubuntu:ubuntu --from=force_builder $HOME/bin $HOME/bin -COPY --chown=ubuntu:ubuntu --from=force_builder $HOME/force-udf $HOME/udf WORKDIR /home/ubuntu From 1f5960becfd2474439e6274938b20ef13427d499 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Mon, 22 Dec 2025 13:32:48 +0100 Subject: [PATCH 2/4] Dockerfile: use numerical UID/GID for chown The non-default Docker builders can fail with some incomprehensible message about index out of bounds when they fail to resolve user names. Use the numerical UID/GID for now to avoid that problem. --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 07c7f759..d1b62e7e 100755 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ ARG build=all # Copy src to SOURCE_DIR RUN mkdir -p $SOURCE_DIR WORKDIR $SOURCE_DIR -COPY --chown=ubuntu:ubuntu . . +COPY --chown=1000:1000 . . # Build, install, check FORCE RUN echo "building FORCE" && \ @@ -55,8 +55,10 @@ RUN echo "building FORCE" && \ FROM davidfrantz/base:latest AS force -ADD --link --chown=ubuntu:ubuntu --exclude=.github https://github.com/davidfrantz/force-udf.git $HOME/udf -COPY --chown=ubuntu:ubuntu --from=force_builder $HOME/bin $HOME/bin +# Use numerical UID/GID to avoid name resolving issues with the non-default +# Docker builders. +ADD --link --chown=1000:1000 --exclude=.github https://github.com/davidfrantz/force-udf.git $HOME/udf +COPY --chown=1000:1000 --from=force_builder $HOME/bin $HOME/bin WORKDIR /home/ubuntu From db46d6f42206e0d4be8b83dd82e8efc453ae8758 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Mon, 22 Dec 2025 13:35:23 +0100 Subject: [PATCH 3/4] Dockerfile: COPY with --link This puts the updates from the copy in a separate layer, which is what one wants usually. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d1b62e7e..cf15848d 100755 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ ARG build=all # Copy src to SOURCE_DIR RUN mkdir -p $SOURCE_DIR WORKDIR $SOURCE_DIR -COPY --chown=1000:1000 . . +COPY --link --chown=1000:1000 . . # Build, install, check FORCE RUN echo "building FORCE" && \ @@ -58,7 +58,7 @@ FROM davidfrantz/base:latest AS force # Use numerical UID/GID to avoid name resolving issues with the non-default # Docker builders. ADD --link --chown=1000:1000 --exclude=.github https://github.com/davidfrantz/force-udf.git $HOME/udf -COPY --chown=1000:1000 --from=force_builder $HOME/bin $HOME/bin +COPY --link --chown=1000:1000 --from=force_builder $HOME/bin $HOME/bin WORKDIR /home/ubuntu From 05ca1a33acf8ae58fdb642473c2d46a4bfaccb0c Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Mon, 22 Dec 2025 13:39:57 +0100 Subject: [PATCH 4/4] Dockerfile: remove trailing whitespace --- Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index cf15848d..a2e9c8ec 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,24 @@ # syntax=docker/dockerfile:1 ########################################################################## -# -# This file is part of FORCE - Framework for Operational Radiometric +# +# This file is part of FORCE - Framework for Operational Radiometric # Correction for Environmental monitoring. -# +# # Copyright (C) 2013-2022 David Frantz -# +# # FORCE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # FORCE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with FORCE. If not, see . -# +# ########################################################################## # Copyright (C) 2020-2025 Gergely Padányi-Gulyás (github user fegyi001),