Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@

# base installation to speed up build process
# https://github.com/davidfrantz/base_image
FROM davidfrantz/base:latest AS force_builder
FROM davidfrantz/base:latest AS internal_base

# Refresh package list & upgrade existing packages
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
# Disable interactive frontends.
export DEBIAN_FRONTEND=noninteractive && \
apt-get -y update && apt-get -y upgrade

FROM internal_base AS force_builder

# Environment variables
ENV SOURCE_DIR=$HOME/src/force
Expand All @@ -37,6 +46,27 @@ ENV SOURCE_DIR=$HOME/src/force
ARG debug=disable
ARG build=all

# Refresh package list & upgrade existing packages
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step takes 10 seconds right now, but will take a bit longer if more packages have to be installed. For local builds you normally hit the docker cache so this step rarely executes, and when it does the odds are still quite good that many of the latest packages will be present in the cache-mount.

I'm fairly sure this list can also be trimmed if it's just FORCE's build dependencies we need to install, but it's easier to do that after the build dependencies are no longer part of base_image.

--mount=type=cache,target=/var/lib/apt,sharing=locked \
# Disable interactive frontends.
export DEBIAN_FRONTEND=noninteractive && \
apt-get -y update && apt-get -y upgrade && \
# Install required tools.
apt-get -y install --no-install-recommends \
# speed up building, only effective for local builds
ccache \
# GCC compiler etc.
build-essential \
# needed to find OpenCV
pkgconf \
# Numerical library, dynamically linked in FORCE
libgsl0-dev \
# JSON parsing, dynamically linked in FORCE
libjansson-dev \
# force-higher-level UDFs, dynamically linked in FORCE
python3-dev

# Copy src to SOURCE_DIR
RUN mkdir -p $SOURCE_DIR
WORKDIR $SOURCE_DIR
Expand All @@ -47,7 +77,7 @@ RUN echo "building FORCE" && \
./debug.sh $debug && \
make -j$(nproc) $build

FROM davidfrantz/base:latest AS force
FROM internal_base AS force

ADD --link --chown=root:root --exclude=.github https://github.com/davidfrantz/force-udf.git /usr/local/bin/force/force-udf
COPY --link --chown=root:root --from=force_builder $HOME/src/force/bin /usr/local/bin/force
Expand Down
2 changes: 1 addition & 1 deletion misc/force-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.04-dev:::2026-05-27_14:17:50
3.10.04-dev:::2026-05-28_13:53:01